From 9ecb6a08d84d0e795648d5add64f154bc406914b Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Fri, 30 Jun 2006 01:56:17 -0700 Subject: [PATCH] knfsd: nfsd4: fix open flag passing Since nfsv4 actually keeps around the file descriptors it gets from open (instead of just using them for a single read or write operation), we need to make sure that we can do RDWR opens and not just RDONLY/WRONLY. Signed-off-by: J. Bruce Fields Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/nfsd/vfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/nfsd/vfs.c') diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index f916b170e13..423e1ba0704 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, 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); } -- cgit v1.2.3