From: NeilBrown <neilb@cse.unsw.edu.au>

The rfc recommends allowing read using stateid's from opens that only
requested write access, as clients may in some cases be unable to write
without doing reads.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/nfsd/nfs4state.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/nfsd/nfs4state.c~nfsd4-allow-read-on-open-for-write fs/nfsd/nfs4state.c
--- 25/fs/nfsd/nfs4state.c~nfsd4-allow-read-on-open-for-write	2005-03-21 22:49:54.000000000 -0800
+++ 25-akpm/fs/nfsd/nfs4state.c	2005-03-21 22:49:54.000000000 -0800
@@ -1928,7 +1928,8 @@ static inline int
 access_permit_read(unsigned long access_bmap)
 {
 	return test_bit(NFS4_SHARE_ACCESS_READ, &access_bmap) ||
-		test_bit(NFS4_SHARE_ACCESS_BOTH, &access_bmap);
+		test_bit(NFS4_SHARE_ACCESS_BOTH, &access_bmap) ||
+		test_bit(NFS4_SHARE_ACCESS_WRITE, &access_bmap);
 }
 
 static inline int
_