diff options
author | J. Bruce Fields <bfields@redhat.com> | 2019-04-12 16:26:30 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2019-04-24 09:46:35 -0400 |
commit | 0ca0c9d7edcf4996da3ebf07947c4484d1e3de16 (patch) | |
tree | 3275d3344964de32a9d37d4c97bb41035a763465 /fs/nfsd/vfs.c | |
parent | 0b8f62625dc309651d0efcb6a6247c933acd8b45 (diff) |
nfsd: fh_drop_write in nfsd_unlink
fh_want_write() can now be called twice, but I'm also fixing up the
callers not to do that.
Other cases include setattr and create.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 7dc98e14655d..fc24ee47eab5 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1786,12 +1786,12 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
1786 | rdentry = lookup_one_len(fname, dentry, flen); | 1786 | rdentry = lookup_one_len(fname, dentry, flen); |
1787 | host_err = PTR_ERR(rdentry); | 1787 | host_err = PTR_ERR(rdentry); |
1788 | if (IS_ERR(rdentry)) | 1788 | if (IS_ERR(rdentry)) |
1789 | goto out_nfserr; | 1789 | goto out_drop_write; |
1790 | 1790 | ||
1791 | if (d_really_is_negative(rdentry)) { | 1791 | if (d_really_is_negative(rdentry)) { |
1792 | dput(rdentry); | 1792 | dput(rdentry); |
1793 | err = nfserr_noent; | 1793 | host_err = -ENOENT; |
1794 | goto out; | 1794 | goto out_drop_write; |
1795 | } | 1795 | } |
1796 | 1796 | ||
1797 | if (!type) | 1797 | if (!type) |
@@ -1805,6 +1805,8 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
1805 | host_err = commit_metadata(fhp); | 1805 | host_err = commit_metadata(fhp); |
1806 | dput(rdentry); | 1806 | dput(rdentry); |
1807 | 1807 | ||
1808 | out_drop_write: | ||
1809 | fh_drop_write(fhp); | ||
1808 | out_nfserr: | 1810 | out_nfserr: |
1809 | err = nfserrno(host_err); | 1811 | err = nfserrno(host_err); |
1810 | out: | 1812 | out: |