Patch "nfsd: Fix error cleanup path in nfsd_rename()" has been added to the 6.8-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

    nfsd: Fix error cleanup path in nfsd_rename()

to the 6.8-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:
     nfsd-fix-error-cleanup-path-in-nfsd_rename.patch
and it can be found in the queue-6.8 subdirectory.

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



commit cb45d2959913f0f89a9cceaeb7789b340645d014
Author: Jan Kara <jack@xxxxxxx>
Date:   Mon Mar 18 17:32:09 2024 +0100

    nfsd: Fix error cleanup path in nfsd_rename()
    
    [ Upstream commit 9fe6e9e7b58944037714442384075c17cfde1c56 ]
    
    Commit a8b0026847b8 ("rename(): avoid a deadlock in the case of parents
    having no common ancestor") added an error bail out path. However this
    path does not drop the remount protection that has been acquired. Fix
    the cleanup path to properly drop the remount protection.
    
    Fixes: a8b0026847b8 ("rename(): avoid a deadlock in the case of parents having no common ancestor")
    Signed-off-by: Jan Kara <jack@xxxxxxx>
    Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Acked-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index b7c7a9273ea01..4ed1e83defa23 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1833,7 +1833,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
 	trap = lock_rename(tdentry, fdentry);
 	if (IS_ERR(trap)) {
 		err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
-		goto out;
+		goto out_want_write;
 	}
 	err = fh_fill_pre_attrs(ffhp);
 	if (err != nfs_ok)
@@ -1903,6 +1903,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
 	}
 out_unlock:
 	unlock_rename(tdentry, fdentry);
+out_want_write:
 	fh_drop_write(ffhp);
 
 	/*




[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