Skip to content

Commit

Permalink
NFSD: Avoid calling fh_drop_write() twice in do_nfsd_create()
Browse files Browse the repository at this point in the history
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 <chuck.lever@oracle.com>
  • Loading branch information
chucklever committed May 20, 2022
1 parent e615685 commit 14ee45b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,18 +1479,15 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
case NFS3_CREATE_GUARDED:
err = nfserr_exist;
}
fh_drop_write(fhp);
goto out;
}

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

host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true);
if (host_err < 0) {
fh_drop_write(fhp);
if (host_err < 0)
goto out_nfserr;
}
if (created)
*created = true;

Expand Down

0 comments on commit 14ee45b

Please sign in to comment.