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.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index da3ec74d8a43..c9e3b5a8fe07 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -672,7 +672,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
672 goto out_nfserr; 672 goto out_nfserr;
673 673
674 if (access & MAY_WRITE) { 674 if (access & MAY_WRITE) {
675 flags = O_WRONLY|O_LARGEFILE; 675 if (access & MAY_READ)
676 flags = O_RDWR|O_LARGEFILE;
677 else
678 flags = O_WRONLY|O_LARGEFILE;
676 679
677 DQUOT_INIT(inode); 680 DQUOT_INIT(inode);
678 } 681 }
@@ -833,7 +836,7 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
833 if (ra && ra->p_set) 836 if (ra && ra->p_set)
834 file->f_ra = ra->p_ra; 837 file->f_ra = ra->p_ra;
835 838
836 if (file->f_op->sendfile) { 839 if (file->f_op->sendfile && rqstp->rq_sendfile_ok) {
837 svc_pushback_unused_pages(rqstp); 840 svc_pushback_unused_pages(rqstp);
838 err = file->f_op->sendfile(file, &offset, *count, 841 err = file->f_op->sendfile(file, &offset, *count,
839 nfsd_read_actor, rqstp); 842 nfsd_read_actor, rqstp);
@@ -1516,14 +1519,15 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp,
1516 err = nfserrno(err); 1519 err = nfserrno(err);
1517 } 1520 }
1518 1521
1519 fh_unlock(ffhp);
1520 dput(dnew); 1522 dput(dnew);
1523out_unlock:
1524 fh_unlock(ffhp);
1521out: 1525out:
1522 return err; 1526 return err;
1523 1527
1524out_nfserr: 1528out_nfserr:
1525 err = nfserrno(err); 1529 err = nfserrno(err);
1526 goto out; 1530 goto out_unlock;
1527} 1531}
1528 1532
1529/* 1533/*
@@ -1552,7 +1556,7 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,
1552 tdir = tdentry->d_inode; 1556 tdir = tdentry->d_inode;
1553 1557
1554 err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev; 1558 err = (rqstp->rq_vers == 2) ? nfserr_acces : nfserr_xdev;
1555 if (fdir->i_sb != tdir->i_sb) 1559 if (ffhp->fh_export != tfhp->fh_export)
1556 goto out; 1560 goto out;
1557 1561
1558 err = nfserr_perm; 1562 err = nfserr_perm;