lockd: fix failure to cleanup client locks
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 18 Jan 2022 22:00:51 +0000 (17:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Feb 2022 11:38:57 +0000 (12:38 +0100)
commit6dfc954efb98438b46e1906bddc5d4f7dc950f4c
tree6ec5d555ddf950302018f5b3c6a629fa56e97bef
parentcb5864bf93b26c867e53c4f1cdace12e9805ec6d
lockd: fix failure to cleanup client locks

commit d19a7af73b5ecaac8168712d18be72b9db166768 upstream.

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 7f024fcd5c97 ("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: 7f024fcd5c97 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/lockd/svcsubs.c