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.

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 <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Jeff Layton and committed by
Chuck Lever
9f27783b 69efce00

+4 -3
+4 -3
fs/lockd/svclock.c
··· 699 699 block = nlmsvc_lookup_block(file, lock); 700 700 mutex_unlock(&file->f_mutex); 701 701 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); 705 706 status = nlmsvc_unlink_block(block); 706 707 nlmsvc_release_block(block); 707 708 }