diff options
author | NeilBrown <neilb@suse.de> | 2022-07-26 09:45:30 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-08-04 17:28:19 +0300 |
commit | b677c0c63a135a916493c064906582e9f3ed4802 (patch) | |
tree | 37b44bbc131d2bcdd67fadefb9cbad0402b49c88 /fs/nfsd/nfs4proc.c | |
parent | 927bfc5600cd6333c9ef9f090f19e66b7d4c8ee1 (diff) | |
download | linux-b677c0c63a135a916493c064906582e9f3ed4802.tar.xz |
NFSD: always drop directory lock in nfsd_unlink()
Some error paths in nfsd_unlink() allow it to exit without unlocking the
directory. This is not a problem in practice as the directory will be
locked with an fh_put(), but it is untidy and potentially confusing.
This allows us to remove all the fh_unlock() calls that are immediately
after nfsd_unlink() calls.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index d585c01d8da6..8d01cb6d04e3 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1002,10 +1002,8 @@ nfsd4_remove(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, return nfserr_grace; status = nfsd_unlink(rqstp, &cstate->current_fh, 0, remove->rm_name, remove->rm_namelen); - if (!status) { - fh_unlock(&cstate->current_fh); + if (!status) set_change_info(&remove->rm_cinfo, &cstate->current_fh); - } return status; } |