aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfsd/vfs.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 2a8d665b134b..1d72f993b66e 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -865,6 +865,15 @@ static int nfsd_direct_splice_actor(struct pipe_inode_info *pipe,
865 return __splice_from_pipe(pipe, sd, nfsd_splice_actor); 865 return __splice_from_pipe(pipe, sd, nfsd_splice_actor);
866} 866}
867 867
868static inline int svc_msnfs(struct svc_fh *ffhp)
869{
870#ifdef MSNFS
871 return (ffhp->fh_export->ex_flags & NFSEXP_MSNFS);
872#else
873 return 0;
874#endif
875}
876
868static __be32 877static __be32
869nfsd_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,
870 loff_t offset, struct kvec *vec, int vlen, unsigned long *count) 879 loff_t offset, struct kvec *vec, int vlen, unsigned long *count)
@@ -877,11 +886,9 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
877 886
878 err = nfserr_perm; 887 err = nfserr_perm;
879 inode = file->f_path.dentry->d_inode; 888 inode = file->f_path.dentry->d_inode;
880#ifdef MSNFS 889
881 if ((fhp->fh_export->ex_flags & NFSEXP_MSNFS) && 890 if (svc_msnfs(fhp) && !lock_may_read(inode, offset, *count))
882 (!lock_may_read(inode, offset, *count)))
883 goto out; 891 goto out;
884#endif
885 892
886 /* Get readahead parameters */ 893 /* Get readahead parameters */
887 ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino); 894 ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino);