aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/export.c4
-rw-r--r--fs/nfsd/vfs.c41
2 files changed, 2 insertions, 43 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index c0fcb7ab7f6d..8b31e5f8795d 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1,4 +1,3 @@
1#define MSNFS /* HACK HACK */
2/* 1/*
3 * NFS exporting and validation. 2 * NFS exporting and validation.
4 * 3 *
@@ -1444,9 +1443,6 @@ static struct flags {
1444 { NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}}, 1443 { NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}},
1445 { NFSEXP_NOAUTHNLM, {"insecure_locks", ""}}, 1444 { NFSEXP_NOAUTHNLM, {"insecure_locks", ""}},
1446 { NFSEXP_V4ROOT, {"v4root", ""}}, 1445 { NFSEXP_V4ROOT, {"v4root", ""}},
1447#ifdef MSNFS
1448 { NFSEXP_MSNFS, {"msnfs", ""}},
1449#endif
1450 { 0, {"", ""}} 1446 { 0, {"", ""}}
1451}; 1447};
1452 1448
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index b991125ce4a5..0a01e2fc5dda 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1,4 +1,3 @@
1#define MSNFS /* HACK HACK */
2/* 1/*
3 * File operations used by nfsd. Some of these have been ripped from 2 * File operations used by nfsd. Some of these have been ripped from
4 * other parts of the kernel because they weren't exported, others 3 * other parts of the kernel because they weren't exported, others
@@ -875,15 +874,6 @@ static int nfsd_direct_splice_actor(struct pipe_inode_info *pipe,
875 return __splice_from_pipe(pipe, sd, nfsd_splice_actor); 874 return __splice_from_pipe(pipe, sd, nfsd_splice_actor);
876} 875}
877 876
878static inline int svc_msnfs(struct svc_fh *ffhp)
879{
880#ifdef MSNFS
881 return (ffhp->fh_export->ex_flags & NFSEXP_MSNFS);
882#else
883 return 0;
884#endif
885}
886
887static __be32 877static __be32
888nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file, 878nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
889 loff_t offset, struct kvec *vec, int vlen, unsigned long *count) 879 loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
@@ -896,9 +886,6 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
896 err = nfserr_perm; 886 err = nfserr_perm;
897 inode = file->f_path.dentry->d_inode; 887 inode = file->f_path.dentry->d_inode;
898 888
899 if (svc_msnfs(fhp) && !lock_may_read(inode, offset, *count))
900 goto out;
901
902 if (file->f_op->splice_read && rqstp->rq_splice_ok) { 889 if (file->f_op->splice_read && rqstp->rq_splice_ok) {
903 struct splice_desc sd = { 890 struct splice_desc sd = {
904 .len = 0, 891 .len = 0,
@@ -923,7 +910,6 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
923 fsnotify_access(file); 910 fsnotify_access(file);
924 } else 911 } else
925 err = nfserrno(host_err); 912 err = nfserrno(host_err);
926out:
927 return err; 913 return err;
928} 914}
929 915
@@ -988,14 +974,6 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
988 int stable = *stablep; 974 int stable = *stablep;
989 int use_wgather; 975 int use_wgather;
990 976
991#ifdef MSNFS
992 err = nfserr_perm;
993
994 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
995 (!lock_may_write(file->f_path.dentry->d_inode, offset, *cnt)))
996 goto out;
997#endif
998
999 dentry = file->f_path.dentry; 977 dentry = file->f_path.dentry;
1000 inode = dentry->d_inode; 978 inode = dentry->d_inode;
1001 exp = fhp->fh_export; 979 exp = fhp->fh_export;
@@ -1046,7 +1024,6 @@ out_nfserr:
1046 err = 0; 1024 err = 0;
1047 else 1025 else
1048 err = nfserrno(host_err); 1026 err = nfserrno(host_err);
1049out:
1050 return err; 1027 return err;
1051} 1028}
1052 1029
@@ -1751,13 +1728,6 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
1751 if (ndentry == trap) 1728 if (ndentry == trap)
1752 goto out_dput_new; 1729 goto out_dput_new;
1753 1730
1754 if (svc_msnfs(ffhp) &&
1755 ((atomic_read(&odentry->d_count) > 1)
1756 || (atomic_read(&ndentry->d_count) > 1))) {
1757 host_err = -EPERM;
1758 goto out_dput_new;
1759 }
1760
1761 host_err = -EXDEV; 1731 host_err = -EXDEV;
1762 if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) 1732 if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt)
1763 goto out_dput_new; 1733 goto out_dput_new;
@@ -1836,17 +1806,10 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
1836 if (host_err) 1806 if (host_err)
1837 goto out_nfserr; 1807 goto out_nfserr;
1838 1808
1839 if (type != S_IFDIR) { /* It's UNLINK */ 1809 if (type != S_IFDIR)
1840#ifdef MSNFS
1841 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
1842 (atomic_read(&rdentry->d_count) > 1)) {
1843 host_err = -EPERM;
1844 } else
1845#endif
1846 host_err = vfs_unlink(dirp, rdentry); 1810 host_err = vfs_unlink(dirp, rdentry);
1847 } else { /* It's RMDIR */ 1811 else
1848 host_err = vfs_rmdir(dirp, rdentry); 1812 host_err = vfs_rmdir(dirp, rdentry);
1849 }
1850 1813
1851 dput(rdentry); 1814 dput(rdentry);
1852 1815