Skip to content

Commit 9fe6e9e

Browse files
jankarachucklever
authored andcommitted
nfsd: Fix error cleanup path in nfsd_rename()
Commit a8b0026 ("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: a8b0026 ("rename(): avoid a deadlock in the case of parents having no common ancestor") Signed-off-by: Jan Kara <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Acked-by: Al Viro <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 9b350d3 commit 9fe6e9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfsd/vfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1853,7 +1853,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
18531853
trap = lock_rename(tdentry, fdentry);
18541854
if (IS_ERR(trap)) {
18551855
err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
1856-
goto out;
1856+
goto out_want_write;
18571857
}
18581858
err = fh_fill_pre_attrs(ffhp);
18591859
if (err != nfs_ok)
@@ -1923,6 +1923,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
19231923
}
19241924
out_unlock:
19251925
unlock_rename(tdentry, fdentry);
1926+
out_want_write:
19261927
fh_drop_write(ffhp);
19271928

19281929
/*

0 commit comments

Comments
 (0)