Skip to content

Commit eeeadbb

Browse files
author
J. Bruce Fields
committed
nfsd: move some commit_metadata()s outside the inode lock
The commit may be time-consuming and there's no need to hold the lock for it. More of these are possible, these were just some easy ones. Signed-off-by: J. Bruce Fields <[email protected]>
1 parent e5d74a2 commit eeeadbb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/nfsd/vfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,9 +1613,9 @@ nfsd_symlink(struct svc_rqst *rqstp, struct svc_fh *fhp,
16131613

16141614
host_err = vfs_symlink(&init_user_ns, d_inode(dentry), dnew, path);
16151615
err = nfserrno(host_err);
1616+
fh_unlock(fhp);
16161617
if (!err)
16171618
err = nfserrno(commit_metadata(fhp));
1618-
fh_unlock(fhp);
16191619

16201620
fh_drop_write(fhp);
16211621

@@ -1680,6 +1680,7 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
16801680
if (d_really_is_negative(dold))
16811681
goto out_dput;
16821682
host_err = vfs_link(dold, &init_user_ns, dirp, dnew, NULL);
1683+
fh_unlock(ffhp);
16831684
if (!host_err) {
16841685
err = nfserrno(commit_metadata(ffhp));
16851686
if (!err)
@@ -1902,10 +1903,10 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
19021903
host_err = vfs_rmdir(&init_user_ns, dirp, rdentry);
19031904
}
19041905

1906+
fh_unlock(fhp);
19051907
if (!host_err)
19061908
host_err = commit_metadata(fhp);
19071909
dput(rdentry);
1908-
fh_unlock(fhp);
19091910
iput(rinode); /* truncate the inode here */
19101911

19111912
out_drop_write:

0 commit comments

Comments
 (0)