nfsd: Fix error cleanup path in nfsd_rename()
BugLink: https://bugs.launchpad.net/bugs/2065400 [ Upstream commit 9fe6e9e7b58944037714442384075c17cfde1c56 ] Commita8b0026847("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:a8b0026847("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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
+2
-1
@@ -1833,7 +1833,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)
|
||||
@@ -1903,6 +1903,7 @@ retry:
|
||||
}
|
||||
out_unlock:
|
||||
unlock_rename(tdentry, fdentry);
|
||||
out_want_write:
|
||||
fh_drop_write(ffhp);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user