diff options
author | Jan Kara <jack@suse.cz> | 2024-03-18 17:32:09 +0100 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-03-22 09:52:00 -0400 |
commit | 9fe6e9e7b58944037714442384075c17cfde1c56 (patch) | |
tree | b6a276bdd64d40283b56c02753413aad51019f86 /fs/nfsd | |
parent | 9b350d3e349f2c4ba4e046001446d533471844a7 (diff) | |
download | linux-9fe6e9e7b58944037714442384075c17cfde1c56.tar.gz linux-9fe6e9e7b58944037714442384075c17cfde1c56.tar.bz2 linux-9fe6e9e7b58944037714442384075c17cfde1c56.zip |
nfsd: Fix error cleanup path in nfsd_rename()
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@suse.cz>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/vfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 6a4c506038e0..daf5221ef922 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1853,7 +1853,7 @@ retry: 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) @@ -1923,6 +1923,7 @@ retry: } out_unlock: unlock_rename(tdentry, fdentry); +out_want_write: fh_drop_write(ffhp); /* |