Skip to content

Commit 9f27783

Browse files
jtlaytonChuck Lever
authored andcommitted
lockd: fix file selection in nlmsvc_cancel_blocked
We currently do a lock_to_openmode call based on the arguments from the NLM_UNLOCK call, but that will always set the fl_type of the lock to F_UNLCK, and the O_RDONLY descriptor is always chosen. Fix it to use the file_lock from the block instead. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 69efce0 commit 9f27783

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/lockd/svclock.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,10 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
699699
block = nlmsvc_lookup_block(file, lock);
700700
mutex_unlock(&file->f_mutex);
701701
if (block != NULL) {
702-
mode = lock_to_openmode(&lock->fl);
703-
vfs_cancel_lock(block->b_file->f_file[mode],
704-
&block->b_call->a_args.lock.fl);
702+
struct file_lock *fl = &block->b_call->a_args.lock.fl;
703+
704+
mode = lock_to_openmode(fl);
705+
vfs_cancel_lock(block->b_file->f_file[mode], fl);
705706
status = nlmsvc_unlink_block(block);
706707
nlmsvc_release_block(block);
707708
}

0 commit comments

Comments
 (0)