Skip to content

Commit d19a7af

Browse files
J. Bruce Fieldschucklever
authored andcommitted
lockd: fix failure to cleanup client locks
In my testing, we're sometimes hitting the request->fl_flags & FL_EXISTS case in posix_lock_inode, presumably just by random luck since we're not actually initializing fl_flags here. This probably didn't matter before commit 7f024fc ("Keep read and write fds with each nlm_file") since we wouldn't previously unlock unless we knew there were locks. But now it causes lockd to give up on removing more locks. We could just initialize fl_flags, but really it seems dubious to be calling vfs_lock_file with random values in some of the fields. Fixes: 7f024fc ("Keep read and write fds with each nlm_file") Signed-off-by: J. Bruce Fields <bfields@redhat.com> [ cel: fixed checkpatch.pl nit ] Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 6e7f90d commit d19a7af

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/lockd/svcsubs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ static int nlm_unlock_files(struct nlm_file *file)
180180
{
181181
struct file_lock lock;
182182

183+
locks_init_lock(&lock);
183184
lock.fl_type = F_UNLCK;
184185
lock.fl_start = 0;
185186
lock.fl_end = OFFSET_MAX;

0 commit comments

Comments
 (0)