aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4state.c6
-rw-r--r--fs/nfsd/vfs.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 591dc6ba6e19..9daa0b9feb8d 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1790,10 +1790,10 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf
1790 } else { 1790 } else {
1791 /* Stateid was not found, this is a new OPEN */ 1791 /* Stateid was not found, this is a new OPEN */
1792 int flags = 0; 1792 int flags = 0;
1793 if (open->op_share_access & NFS4_SHARE_ACCESS_READ)
1794 flags |= MAY_READ;
1793 if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) 1795 if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
1794 flags = MAY_WRITE; 1796 flags |= MAY_WRITE;
1795 else
1796 flags = MAY_READ;
1797 status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags); 1797 status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags);
1798 if (status) 1798 if (status)
1799 goto out; 1799 goto out;
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index f916b170e136..423e1ba07044 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -673,7 +673,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type,
673 goto out_nfserr; 673 goto out_nfserr;
674 674
675 if (access & MAY_WRITE) { 675 if (access & MAY_WRITE) {
676 flags = O_WRONLY|O_LARGEFILE; 676 if (access & MAY_READ)
677 flags = O_RDWR|O_LARGEFILE;
678 else
679 flags = O_WRONLY|O_LARGEFILE;
677 680
678 DQUOT_INIT(inode); 681 DQUOT_INIT(inode);
679 } 682 }