aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/vfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r--fs/nfsd/vfs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 245eaa1fb59b..c9e3b5a8fe07 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -16,7 +16,6 @@
16 * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka@valinux.co.jp> 16 * Zerocpy NFS support (C) 2002 Hirokazu Takahashi <taka@valinux.co.jp>
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/string.h> 19#include <linux/string.h>
21#include <linux/time.h> 20#include <linux/time.h>
22#include <linux/errno.h> 21#include <linux/errno.h>
@@ -673,7 +672,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
673 goto out_nfserr; 672 goto out_nfserr;
674 673
675 if (access & MAY_WRITE) { 674 if (access & MAY_WRITE) {
676 flags = O_WRONLY|O_LARGEFILE; 675 if (access & MAY_READ)
676 flags = O_RDWR|O_LARGEFILE;
677 else
678 flags = O_WRONLY|O_LARGEFILE;
677 679
678 DQUOT_INIT(inode); 680 DQUOT_INIT(inode);
679 } 681 }
@@ -834,7 +836,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
834 if (ra && ra->p_set) 836 if (ra && ra->p_set)
835 file->f_ra = ra->p_ra; 837 file->f_ra = ra->p_ra;
836 838
837 if (file->f_op->sendfile) { 839 if (file->f_op->sendfile && rqstp->rq_sendfile_ok) {
838 svc_pushback_unused_pages(rqstp); 840 svc_pushback_unused_pages(rqstp);
839 err = file->f_op->sendfile(file, &offset, *count, 841 err = file->f_op->sendfile(file, &offset, *count,
840 nfsd_read_actor, rqstp); 842 nfsd_read_actor, rqstp);
@@ -1517,14 +1519,15 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
1517 err = nfserrno(err); 1519 err = nfserrno(err);
1518 } 1520 }
1519 1521
1520 fh_unlock(ffhp);
1521 dput(dnew); 1522 dput(dnew);
1523out_unlock:
1524 fh_unlock(ffhp);
1522out: 1525out:
1523 return err; 1526 return err;
1524 1527
1525out_nfserr: 1528out_nfserr:
1526 err = nfserrno(err); 1529 err = nfserrno(err);
1527 goto out; 1530 goto out_unlock;
1528} 1531}
1529 1532
1530/* 1533/*
@@ -1553,7 +1556,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
1553 tdir = tdentry->d_inode; 1556 tdir = tdentry->d_inode;
1554 1557
1555 err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev; 1558 err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
1556 if (fdir->i_sb != tdir->i_sb) 1559 if (ffhp->fh_export != tfhp->fh_export)
1557 goto out; 1560 goto out;
1558 1561
1559 err = nfserr_perm; 1562 err = nfserr_perm;