From c8d258d4f8954bcca2cf03e2f73f5d725dfacb50 Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Apr 05 2024 10:25:11 +0000 Subject: nfsd: Fix error cleanup path in nfsd_rename() (git-fixes). --- diff --git a/patches.suse/nfsd-Fix-error-cleanup-path-in-nfsd_rename.patch b/patches.suse/nfsd-Fix-error-cleanup-path-in-nfsd_rename.patch new file mode 100644 index 0000000..b8c69be --- /dev/null +++ b/patches.suse/nfsd-Fix-error-cleanup-path-in-nfsd_rename.patch @@ -0,0 +1,47 @@ +From d3b726e236c8833fcaa1a1633731a579ab7e5c0f Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Mon, 18 Mar 2024 17:32:09 +0100 +Subject: [PATCH] nfsd: Fix error cleanup path in nfsd_rename() +Git-commit: 9fe6e9e7b58944037714442384075c17cfde1c56 +Patch-mainline: v6.9-rc2 +References: git-fixes + +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 +Reviewed-by: Jeff Layton +Acked-by: Al Viro +Signed-off-by: Chuck Lever +Signed-off-by: Denis Kirjanov +--- + fs/nfsd/vfs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c +index dea58c838c98..35cb4f4f9270 100644 +--- a/fs/nfsd/vfs.c ++++ b/fs/nfsd/vfs.c +@@ -1706,7 +1706,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; + } + ffhp->fh_locked = tfhp->fh_locked = true; + fill_pre_wcc(ffhp); +@@ -1753,6 +1753,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen, + fill_post_wcc(tfhp); + unlock_rename(tdentry, fdentry); + ffhp->fh_locked = tfhp->fh_locked = false; ++out_want_write: + fh_drop_write(ffhp); + + out: +-- +2.16.4 + diff --git a/series.conf b/series.conf index 78e4984..85c6b4e 100644 --- a/series.conf +++ b/series.conf @@ -65056,6 +65056,7 @@ patches.suse/net-sunrpc-Fix-an-off-by-one-in-rpc_sockaddr2uaddr.patch patches.suse/NFS-Fix-an-off-by-one-in-root_nfs_cat.patch patches.suse/s390-vtime-fix-average-steal-time-calculation.patch + patches.suse/nfsd-Fix-error-cleanup-path-in-nfsd_rename.patch patches.suse/scsi-qla2xxx-Prevent-command-send-on-chip-reset.patch patches.suse/scsi-qla2xxx-Fix-N2N-stuck-connection.patch patches.suse/scsi-qla2xxx-Split-FCE-EFT-trace-control.patch