Patch "lockd: fix failure to cleanup client locks" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    lockd: fix failure to cleanup client locks

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     lockd-fix-failure-to-cleanup-client-locks.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit f2790c63d6870c588952f2fbdc4e55683479ff49
Author: J. Bruce Fields <bfields@xxxxxxxxxxxx>
Date:   Tue Jan 18 17:00:51 2022 -0500

    lockd: fix failure to cleanup client locks
    
    [ Upstream commit d19a7af73b5ecaac8168712d18be72b9db166768 ]
    
    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@xxxxxxxxxx>
    [ cel: fixed checkpatch.pl nit ]
    Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index 54c2e42130ca2..0a22a2faf5522 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -180,6 +180,7 @@ static int nlm_unlock_files(struct nlm_file *file)
 {
 	struct file_lock lock;
 
+	locks_init_lock(&lock);
 	lock.fl_type  = F_UNLCK;
 	lock.fl_start = 0;
 	lock.fl_end   = OFFSET_MAX;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux