Skip to content

Commit 14ee45b

Browse files
committed
NFSD: Avoid calling fh_drop_write() twice in do_nfsd_create()
Clean up: The "out" label already invokes fh_drop_write(). Note that fh_drop_write() is already careful not to invoke mnt_drop_write() if either it has already been done or there is nothing to drop. Therefore no change in behavior is expected. Signed-off-by: Chuck Lever <[email protected]>
1 parent e615685 commit 14ee45b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fs/nfsd/vfs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,18 +1479,15 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
14791479
case NFS3_CREATE_GUARDED:
14801480
err = nfserr_exist;
14811481
}
1482-
fh_drop_write(fhp);
14831482
goto out;
14841483
}
14851484

14861485
if (!IS_POSIXACL(dirp))
14871486
iap->ia_mode &= ~current_umask();
14881487

14891488
host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true);
1490-
if (host_err < 0) {
1491-
fh_drop_write(fhp);
1489+
if (host_err < 0)
14921490
goto out_nfserr;
1493-
}
14941491
if (created)
14951492
*created = true;
14961493

0 commit comments

Comments
 (0)