Skip to content

Commit

Permalink
nfsd: don't leak dentry count on mnt_want_write failure
Browse files Browse the repository at this point in the history
The exit cleanup isn't quite right here.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Feb 14, 2011
1 parent 1bae4ce commit 541ce98
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,22 +1812,22 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,

host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
if (host_err)
goto out_nfserr;
goto out_put;

host_err = nfsd_break_lease(rdentry->d_inode);
if (host_err)
goto out_put;
goto out_drop_write;
if (type != S_IFDIR)
host_err = vfs_unlink(dirp, rdentry);
else
host_err = vfs_rmdir(dirp, rdentry);
out_put:
dput(rdentry);

if (!host_err)
host_err = commit_metadata(fhp);

out_drop_write:
mnt_drop_write(fhp->fh_export->ex_path.mnt);
out_put:
dput(rdentry);

out_nfserr:
err = nfserrno(host_err);
out:
Expand Down

0 comments on commit 541ce98

Please sign in to comment.