diff options
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 46f59d5365a0..efff58a5818c 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1750,6 +1750,10 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
1750 | if (!type) | 1750 | if (!type) |
1751 | type = rdentry->d_inode->i_mode & S_IFMT; | 1751 | type = rdentry->d_inode->i_mode & S_IFMT; |
1752 | 1752 | ||
1753 | host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); | ||
1754 | if (host_err) | ||
1755 | goto out_nfserr; | ||
1756 | |||
1753 | if (type != S_IFDIR) { /* It's UNLINK */ | 1757 | if (type != S_IFDIR) { /* It's UNLINK */ |
1754 | #ifdef MSNFS | 1758 | #ifdef MSNFS |
1755 | if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && | 1759 | if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && |
@@ -1765,10 +1769,12 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, | |||
1765 | dput(rdentry); | 1769 | dput(rdentry); |
1766 | 1770 | ||
1767 | if (host_err) | 1771 | if (host_err) |
1768 | goto out_nfserr; | 1772 | goto out_drop; |
1769 | if (EX_ISSYNC(fhp->fh_export)) | 1773 | if (EX_ISSYNC(fhp->fh_export)) |
1770 | host_err = nfsd_sync_dir(dentry); | 1774 | host_err = nfsd_sync_dir(dentry); |
1771 | 1775 | ||
1776 | out_drop: | ||
1777 | mnt_drop_write(fhp->fh_export->ex_path.mnt); | ||
1772 | out_nfserr: | 1778 | out_nfserr: |
1773 | err = nfserrno(host_err); | 1779 | err = nfserrno(host_err); |
1774 | out: | 1780 | out: |