Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231184
b: refs/heads/master
c: 9ce137e
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Jan 14, 2011
1 parent 9140bfb commit 5c51ead
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 45 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ee1ba5402e9d35fb35f8e61c968f4987b5fb443
refs/heads/master: 9ce137eee4febaabca81143be07d4205d2bd52d4
4 changes: 0 additions & 4 deletions trunk/fs/nfsd/export.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define MSNFS /* HACK HACK */
/*
* NFS exporting and validation.
*
Expand Down Expand Up @@ -1444,9 +1443,6 @@ static struct flags {
{ NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}},
{ NFSEXP_NOAUTHNLM, {"insecure_locks", ""}},
{ NFSEXP_V4ROOT, {"v4root", ""}},
#ifdef MSNFS
{ NFSEXP_MSNFS, {"msnfs", ""}},
#endif
{ 0, {"", ""}}
};

Expand Down
41 changes: 2 additions & 39 deletions trunk/fs/nfsd/vfs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define MSNFS /* HACK HACK */
/*
* File operations used by nfsd. Some of these have been ripped from
* other parts of the kernel because they weren't exported, others
Expand Down Expand Up @@ -875,15 +874,6 @@ static int nfsd_direct_splice_actor(struct pipe_inode_info *pipe,
return __splice_from_pipe(pipe, sd, nfsd_splice_actor);
}

static inline int svc_msnfs(struct svc_fh *ffhp)
{
#ifdef MSNFS
return (ffhp->fh_export->ex_flags & NFSEXP_MSNFS);
#else
return 0;
#endif
}

static __be32
nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
Expand All @@ -896,9 +886,6 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
err = nfserr_perm;
inode = file->f_path.dentry->d_inode;

if (svc_msnfs(fhp) && !lock_may_read(inode, offset, *count))
goto out;

if (file->f_op->splice_read && rqstp->rq_splice_ok) {
struct splice_desc sd = {
.len = 0,
Expand All @@ -923,7 +910,6 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
fsnotify_access(file);
} else
err = nfserrno(host_err);
out:
return err;
}

Expand Down Expand Up @@ -988,14 +974,6 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
int stable = *stablep;
int use_wgather;

#ifdef MSNFS
err = nfserr_perm;

if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
(!lock_may_write(file->f_path.dentry->d_inode, offset, *cnt)))
goto out;
#endif

dentry = file->f_path.dentry;
inode = dentry->d_inode;
exp = fhp->fh_export;
Expand Down Expand Up @@ -1046,7 +1024,6 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
err = 0;
else
err = nfserrno(host_err);
out:
return err;
}

Expand Down Expand Up @@ -1751,13 +1728,6 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
if (ndentry == trap)
goto out_dput_new;

if (svc_msnfs(ffhp) &&
((atomic_read(&odentry->d_count) > 1)
|| (atomic_read(&ndentry->d_count) > 1))) {
host_err = -EPERM;
goto out_dput_new;
}

host_err = -EXDEV;
if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt)
goto out_dput_new;
Expand Down Expand Up @@ -1836,17 +1806,10 @@ nfsd_unlink(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
if (host_err)
goto out_nfserr;

if (type != S_IFDIR) { /* It's UNLINK */
#ifdef MSNFS
if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) &&
(atomic_read(&rdentry->d_count) > 1)) {
host_err = -EPERM;
} else
#endif
if (type != S_IFDIR)
host_err = vfs_unlink(dirp, rdentry);
} else { /* It's RMDIR */
else
host_err = vfs_rmdir(dirp, rdentry);
}

dput(rdentry);

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/nfsd/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define NFSEXP_NOHIDE 0x0200
#define NFSEXP_NOSUBTREECHECK 0x0400
#define NFSEXP_NOAUTHNLM 0x0800 /* Don't authenticate NLM requests - just trust */
#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect */
#define NFSEXP_MSNFS 0x1000 /* do silly things that MS clients expect; no longer supported */
#define NFSEXP_FSID 0x2000
#define NFSEXP_CROSSMOUNT 0x4000
#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
Expand Down

0 comments on commit 5c51ead

Please sign in to comment.