nfsd: don't leak dentry count on mnt_want_write failure
The exit cleanup isn't quite right here. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Родитель
1bae4ce27c
Коммит
541ce98c10
|
@ -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);
|
host_err = mnt_want_write(fhp->fh_export->ex_path.mnt);
|
||||||
if (host_err)
|
if (host_err)
|
||||||
goto out_nfserr;
|
goto out_put;
|
||||||
|
|
||||||
host_err = nfsd_break_lease(rdentry->d_inode);
|
host_err = nfsd_break_lease(rdentry->d_inode);
|
||||||
if (host_err)
|
if (host_err)
|
||||||
goto out_put;
|
goto out_drop_write;
|
||||||
if (type != S_IFDIR)
|
if (type != S_IFDIR)
|
||||||
host_err = vfs_unlink(dirp, rdentry);
|
host_err = vfs_unlink(dirp, rdentry);
|
||||||
else
|
else
|
||||||
host_err = vfs_rmdir(dirp, rdentry);
|
host_err = vfs_rmdir(dirp, rdentry);
|
||||||
|
if (!host_err)
|
||||||
|
host_err = commit_metadata(fhp);
|
||||||
|
out_drop_write:
|
||||||
|
mnt_drop_write(fhp->fh_export->ex_path.mnt);
|
||||||
out_put:
|
out_put:
|
||||||
dput(rdentry);
|
dput(rdentry);
|
||||||
|
|
||||||
if (!host_err)
|
|
||||||
host_err = commit_metadata(fhp);
|
|
||||||
|
|
||||||
mnt_drop_write(fhp->fh_export->ex_path.mnt);
|
|
||||||
out_nfserr:
|
out_nfserr:
|
||||||
err = nfserrno(host_err);
|
err = nfserrno(host_err);
|
||||||
out:
|
out:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче