]> git.baikalelectronics.ru Git - kernel.git/commit
lockd: fix failure to cleanup client locks
authorJ. Bruce Fields <bfields@redhat.com>
Tue, 18 Jan 2022 22:00:51 +0000 (17:00 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 27 Jan 2022 15:45:25 +0000 (10:45 -0500)
commit4134f2aa6b4025c6dbb1ad604426e041819f541f
treeb04743e6bf80e7af7c5bbde22c7137b3b1a75096
parent491523aa19decfc7827da2722f8d87190d91430c
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 649a9a0eb60a ("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: 649a9a0eb60a ("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>
fs/lockd/svcsubs.c