diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2008-02-15 17:37:34 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-04-19 00:25:33 -0400 |
commit | 0622753b800e4cc6cb9319b36b27658c72dd7cdc (patch) | |
tree | 5a32b65a087ff7fd5effa8d3f6f1f9717d4391aa /fs/nfsd/vfs.c | |
parent | 49e0d02cf018d4edf24bfc8531a816a26367e4ce (diff) |
[PATCH] r/o bind mounts: elevate write count for rmdir and unlink.
Elevate the write count during the vfs_rmdir() and vfs_unlink().
[AV: merged rmdir and unlink parts, added missing pieces in nfsd]
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
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: |