Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NLM: Fix arguments to NLM_CANCEL call

The OpenGroup docs state that the arguments "block", "exclusive" and
"alock" must exactly match the arguments for the lock call that we are
trying to cancel.
Currently, "block" is always set to false, which is wrong.

See bug# 5956 on bugzilla.kernel.org.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

+4 -4
+4 -3
fs/lockd/clntproc.c
··· 28 28 static int nlmclnt_unlock(struct nlm_rqst *, struct file_lock *); 29 29 static int nlm_stat_to_errno(u32 stat); 30 30 static void nlmclnt_locks_init_private(struct file_lock *fl, struct nlm_host *host); 31 + static int nlmclnt_cancel(struct nlm_host *, int , struct file_lock *); 31 32 32 33 static const struct rpc_call_ops nlmclnt_unlock_ops; 33 34 static const struct rpc_call_ops nlmclnt_cancel_ops; ··· 599 598 nlmclnt_finish_block(req); 600 599 /* Cancel the blocked request if it is still pending */ 601 600 if (resp->status == NLM_LCK_BLOCKED) 602 - nlmclnt_cancel(host, fl); 601 + nlmclnt_cancel(host, req->a_args.block, fl); 603 602 out: 604 603 nlmclnt_release_lockargs(req); 605 604 return status; ··· 729 728 * We always use an async RPC call for this in order not to hang a 730 729 * process that has been Ctrl-C'ed. 731 730 */ 732 - int 733 - nlmclnt_cancel(struct nlm_host *host, struct file_lock *fl) 731 + static int nlmclnt_cancel(struct nlm_host *host, int block, struct file_lock *fl) 734 732 { 735 733 struct nlm_rqst *req; 736 734 unsigned long flags; ··· 750 750 req->a_flags = RPC_TASK_ASYNC; 751 751 752 752 nlmclnt_setlockargs(req, fl); 753 + req->a_args.block = block; 753 754 754 755 status = nlmclnt_async_call(req, NLMPROC_CANCEL, &nlmclnt_cancel_ops); 755 756 if (status < 0) {
-1
include/linux/lockd/lockd.h
··· 148 148 int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); 149 149 void nlmclnt_finish_block(struct nlm_rqst *req); 150 150 long nlmclnt_block(struct nlm_rqst *req, long timeout); 151 - int nlmclnt_cancel(struct nlm_host *, struct file_lock *); 152 151 u32 nlmclnt_grant(struct nlm_lock *); 153 152 void nlmclnt_recovery(struct nlm_host *, u32); 154 153 int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);