diff options
| -rw-r--r-- | fs/lockd/host.c | 3 | ||||
| -rw-r--r-- | fs/lockd/svcsubs.c | 19 | ||||
| -rw-r--r-- | include/linux/lockd/lockd.h | 2 |
3 files changed, 16 insertions, 8 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index eb75ca7c2d6e..2c5f41b098e9 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
| @@ -628,13 +628,14 @@ nlm_gc_hosts(void) | |||
| 628 | struct hlist_head *chain; | 628 | struct hlist_head *chain; |
| 629 | struct hlist_node *pos, *next; | 629 | struct hlist_node *pos, *next; |
| 630 | struct nlm_host *host; | 630 | struct nlm_host *host; |
| 631 | struct net *net = &init_net; | ||
| 631 | 632 | ||
| 632 | dprintk("lockd: host garbage collection\n"); | 633 | dprintk("lockd: host garbage collection\n"); |
| 633 | for_each_host(host, pos, chain, nlm_server_hosts) | 634 | for_each_host(host, pos, chain, nlm_server_hosts) |
| 634 | host->h_inuse = 0; | 635 | host->h_inuse = 0; |
| 635 | 636 | ||
| 636 | /* Mark all hosts that hold locks, blocks or shares */ | 637 | /* Mark all hosts that hold locks, blocks or shares */ |
| 637 | nlmsvc_mark_resources(); | 638 | nlmsvc_mark_resources(net); |
| 638 | 639 | ||
| 639 | for_each_host_safe(host, pos, next, chain, nlm_server_hosts) { | 640 | for_each_host_safe(host, pos, next, chain, nlm_server_hosts) { |
| 640 | if (atomic_read(&host->h_count) || host->h_inuse | 641 | if (atomic_read(&host->h_count) || host->h_inuse |
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 2240d384d787..0deb5f6c9dd4 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c | |||
| @@ -309,7 +309,8 @@ nlm_release_file(struct nlm_file *file) | |||
| 309 | * Helpers function for resource traversal | 309 | * Helpers function for resource traversal |
| 310 | * | 310 | * |
| 311 | * nlmsvc_mark_host: | 311 | * nlmsvc_mark_host: |
| 312 | * used by the garbage collector; simply sets h_inuse. | 312 | * used by the garbage collector; simply sets h_inuse only for those |
| 313 | * hosts, which passed network check. | ||
| 313 | * Always returns 0. | 314 | * Always returns 0. |
| 314 | * | 315 | * |
| 315 | * nlmsvc_same_host: | 316 | * nlmsvc_same_host: |
| @@ -320,12 +321,15 @@ nlm_release_file(struct nlm_file *file) | |||
| 320 | * returns 1 iff the host is a client. | 321 | * returns 1 iff the host is a client. |
| 321 | * Used by nlmsvc_invalidate_all | 322 | * Used by nlmsvc_invalidate_all |
| 322 | */ | 323 | */ |
| 324 | |||
| 323 | static int | 325 | static int |
| 324 | nlmsvc_mark_host(void *data, struct nlm_host *dummy) | 326 | nlmsvc_mark_host(void *data, struct nlm_host *hint) |
| 325 | { | 327 | { |
| 326 | struct nlm_host *host = data; | 328 | struct nlm_host *host = data; |
| 327 | 329 | ||
| 328 | host->h_inuse = 1; | 330 | if ((hint->net == NULL) || |
| 331 | (host->net == hint->net)) | ||
| 332 | host->h_inuse = 1; | ||
| 329 | return 0; | 333 | return 0; |
| 330 | } | 334 | } |
| 331 | 335 | ||
| @@ -358,10 +362,13 @@ nlmsvc_is_client(void *data, struct nlm_host *dummy) | |||
| 358 | * Mark all hosts that still hold resources | 362 | * Mark all hosts that still hold resources |
| 359 | */ | 363 | */ |
| 360 | void | 364 | void |
| 361 | nlmsvc_mark_resources(void) | 365 | nlmsvc_mark_resources(struct net *net) |
| 362 | { | 366 | { |
| 363 | dprintk("lockd: nlmsvc_mark_resources\n"); | 367 | struct nlm_host hint; |
| 364 | nlm_traverse_files(NULL, nlmsvc_mark_host, NULL); | 368 | |
| 369 | dprintk("lockd: nlmsvc_mark_resources for net %p\n", net); | ||
| 370 | hint.net = net; | ||
| 371 | nlm_traverse_files(&hint, nlmsvc_mark_host, NULL); | ||
| 365 | } | 372 | } |
| 366 | 373 | ||
| 367 | /* | 374 | /* |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index f04ce6ac6d04..50e31a2c1a97 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -279,7 +279,7 @@ void nlmsvc_release_call(struct nlm_rqst *); | |||
| 279 | __be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, | 279 | __be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, |
| 280 | struct nfs_fh *); | 280 | struct nfs_fh *); |
| 281 | void nlm_release_file(struct nlm_file *); | 281 | void nlm_release_file(struct nlm_file *); |
| 282 | void nlmsvc_mark_resources(void); | 282 | void nlmsvc_mark_resources(struct net *); |
| 283 | void nlmsvc_free_host_resources(struct nlm_host *); | 283 | void nlmsvc_free_host_resources(struct nlm_host *); |
| 284 | void nlmsvc_invalidate_all(void); | 284 | void nlmsvc_invalidate_all(void); |
| 285 | 285 | ||
