diff options
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/clntlock.c | 12 | ||||
-rw-r--r-- | fs/lockd/clntproc.c | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index 4885b53e56bd..6cd673d34fb9 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c | |||
@@ -220,10 +220,19 @@ reclaimer(void *ptr) | |||
220 | { | 220 | { |
221 | struct nlm_host *host = (struct nlm_host *) ptr; | 221 | struct nlm_host *host = (struct nlm_host *) ptr; |
222 | struct nlm_wait *block; | 222 | struct nlm_wait *block; |
223 | struct nlm_rqst *req; | ||
223 | struct file_lock *fl, *next; | 224 | struct file_lock *fl, *next; |
224 | u32 nsmstate; | 225 | u32 nsmstate; |
225 | struct net *net = host->net; | 226 | struct net *net = host->net; |
226 | 227 | ||
228 | req = kmalloc(sizeof(*req), GFP_KERNEL); | ||
229 | if (!req) { | ||
230 | printk(KERN_ERR "lockd: reclaimer unable to alloc memory." | ||
231 | " Locks for %s won't be reclaimed!\n", | ||
232 | host->h_name); | ||
233 | return 0; | ||
234 | } | ||
235 | |||
227 | allow_signal(SIGKILL); | 236 | allow_signal(SIGKILL); |
228 | 237 | ||
229 | down_write(&host->h_rwsem); | 238 | down_write(&host->h_rwsem); |
@@ -253,7 +262,7 @@ restart: | |||
253 | */ | 262 | */ |
254 | if (signalled()) | 263 | if (signalled()) |
255 | continue; | 264 | continue; |
256 | if (nlmclnt_reclaim(host, fl) != 0) | 265 | if (nlmclnt_reclaim(host, fl, req) != 0) |
257 | continue; | 266 | continue; |
258 | list_add_tail(&fl->fl_u.nfs_fl.list, &host->h_granted); | 267 | list_add_tail(&fl->fl_u.nfs_fl.list, &host->h_granted); |
259 | if (host->h_nsmstate != nsmstate) { | 268 | if (host->h_nsmstate != nsmstate) { |
@@ -279,5 +288,6 @@ restart: | |||
279 | /* Release host handle after use */ | 288 | /* Release host handle after use */ |
280 | nlmclnt_release_host(host); | 289 | nlmclnt_release_host(host); |
281 | lockd_down(net); | 290 | lockd_down(net); |
291 | kfree(req); | ||
282 | return 0; | 292 | return 0; |
283 | } | 293 | } |
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 54f9e6ce0430..b43114c4332a 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -615,17 +615,15 @@ out_unlock: | |||
615 | * RECLAIM: Try to reclaim a lock | 615 | * RECLAIM: Try to reclaim a lock |
616 | */ | 616 | */ |
617 | int | 617 | int |
618 | nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl) | 618 | nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl, |
619 | struct nlm_rqst *req) | ||
619 | { | 620 | { |
620 | struct nlm_rqst reqst, *req; | ||
621 | int status; | 621 | int status; |
622 | 622 | ||
623 | req = &reqst; | ||
624 | memset(req, 0, sizeof(*req)); | 623 | memset(req, 0, sizeof(*req)); |
625 | locks_init_lock(&req->a_args.lock.fl); | 624 | locks_init_lock(&req->a_args.lock.fl); |
626 | locks_init_lock(&req->a_res.lock.fl); | 625 | locks_init_lock(&req->a_res.lock.fl); |
627 | req->a_host = host; | 626 | req->a_host = host; |
628 | req->a_flags = 0; | ||
629 | 627 | ||
630 | /* Set up the argument struct */ | 628 | /* Set up the argument struct */ |
631 | nlmclnt_setlockargs(req, fl); | 629 | nlmclnt_setlockargs(req, fl); |