提交 14ee45b7 编写于 作者: C Chuck Lever

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: NChuck Lever <chuck.lever@oracle.com>
上级 e6156859
...@@ -1479,7 +1479,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1479,7 +1479,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
case NFS3_CREATE_GUARDED: case NFS3_CREATE_GUARDED:
err = nfserr_exist; err = nfserr_exist;
} }
fh_drop_write(fhp);
goto out; goto out;
} }
...@@ -1487,10 +1486,8 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, ...@@ -1487,10 +1486,8 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp,
iap->ia_mode &= ~current_umask(); iap->ia_mode &= ~current_umask();
host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true); host_err = vfs_create(&init_user_ns, dirp, dchild, iap->ia_mode, true);
if (host_err < 0) { if (host_err < 0)
fh_drop_write(fhp);
goto out_nfserr; goto out_nfserr;
}
if (created) if (created)
*created = true; *created = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册