From b236557fd9345943eb00affe13411cb2a822fa0d Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Fri, 30 Jun 2006 01:56:17 -0700 Subject: [PATCH] --- yaml --- r: 31422 b: refs/heads/master c: 9ecb6a08d84d0e795648d5add64f154bc406914b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/nfsd/nfs4state.c | 6 +++--- trunk/fs/nfsd/vfs.c | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 98b309112f39..77435a275524 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ba5a6a19d83babe00be3711db3deee5c57587b8f +refs/heads/master: 9ecb6a08d84d0e795648d5add64f154bc406914b diff --git a/trunk/fs/nfsd/nfs4state.c b/trunk/fs/nfsd/nfs4state.c index 591dc6ba6e19..9daa0b9feb8d 100644 --- a/trunk/fs/nfsd/nfs4state.c +++ b/trunk/fs/nfsd/nfs4state.c @@ -1790,10 +1790,10 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf } else { /* Stateid was not found, this is a new OPEN */ int flags = 0; + if (open->op_share_access & NFS4_SHARE_ACCESS_READ) + flags |= MAY_READ; if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) - flags = MAY_WRITE; - else - flags = MAY_READ; + flags |= MAY_WRITE; status = nfs4_new_open(rqstp, &stp, dp, current_fh, flags); if (status) goto out; diff --git a/trunk/fs/nfsd/vfs.c b/trunk/fs/nfsd/vfs.c index f916b170e136..423e1ba07044 100644 --- a/trunk/fs/nfsd/vfs.c +++ b/trunk/fs/nfsd/vfs.c @@ -673,7 +673,10 @@ nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, goto out_nfserr; if (access & MAY_WRITE) { - flags = O_WRONLY|O_LARGEFILE; + if (access & MAY_READ) + flags = O_RDWR|O_LARGEFILE; + else + flags = O_WRONLY|O_LARGEFILE; DQUOT_INIT(inode); }