aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/clntproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/clntproc.c')
-rw-r--r--fs/lockd/clntproc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index 24c691f5480e..89ba0df14c22 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -496,6 +496,7 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
496 struct nlm_host *host = req->a_host; 496 struct nlm_host *host = req->a_host;
497 struct nlm_res *resp = &req->a_res; 497 struct nlm_res *resp = &req->a_res;
498 struct nlm_wait *block = NULL; 498 struct nlm_wait *block = NULL;
499 unsigned char fl_flags = fl->fl_flags;
499 int status = -ENOLCK; 500 int status = -ENOLCK;
500 501
501 if (!host->h_monitored && nsm_monitor(host) < 0) { 502 if (!host->h_monitored && nsm_monitor(host) < 0) {
@@ -503,6 +504,10 @@ nlmclnt_lock(struct nlm_rqst *req, struct file_lock *fl)
503 host->h_name); 504 host->h_name);
504 goto out; 505 goto out;
505 } 506 }
507 fl->fl_flags |= FL_ACCESS;
508 status = do_vfs_lock(fl);
509 if (status < 0)
510 goto out;
506 511
507 block = nlmclnt_prepare_block(host, fl); 512 block = nlmclnt_prepare_block(host, fl);
508again: 513again:
@@ -537,8 +542,8 @@ again:
537 up_read(&host->h_rwsem); 542 up_read(&host->h_rwsem);
538 goto again; 543 goto again;
539 } 544 }
540 fl->fl_flags |= FL_SLEEP;
541 /* Ensure the resulting lock will get added to granted list */ 545 /* Ensure the resulting lock will get added to granted list */
546 fl->fl_flags = fl_flags | FL_SLEEP;
542 if (do_vfs_lock(fl) < 0) 547 if (do_vfs_lock(fl) < 0)
543 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__); 548 printk(KERN_WARNING "%s: VFS is out of sync with lock manager!\n", __FUNCTION__);
544 up_read(&host->h_rwsem); 549 up_read(&host->h_rwsem);
@@ -551,6 +556,7 @@ out_unblock:
551 nlmclnt_cancel(host, req->a_args.block, fl); 556 nlmclnt_cancel(host, req->a_args.block, fl);
552out: 557out:
553 nlm_release_call(req); 558 nlm_release_call(req);
559 fl->fl_flags = fl_flags;
554 return status; 560 return status;
555} 561}
556 562