NFSv4: Make nfs4_state track O_RDWR, O_RDONLY and O_WRONLY separately
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 3 Jan 2006 08:55:13 +0000 (09:55 +0100)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 6 Jan 2006 19:58:43 +0000 (14:58 -0500)
commite761692381f294ea079d2e869fcd7c0afc79e394
tree34ebc00c001cddc94866936c460547d311e5dabb
parentcdd4e68b5f0ed12c64b3e2be83655d2a47588a74
NFSv4: Make nfs4_state track O_RDWR, O_RDONLY and O_WRONLY separately

 A closer reading of RFC3530 reveals that OPEN_DOWNGRADE must always
 specify a access modes that have been the argument of a previous OPEN
 operation.
 IOW: doing OPEN(O_RDWR) and then OPEN_DOWNGRADE(O_WRONLY) is forbidden
 unless the user called OPEN(O_WRONLY)

 In order to fix that, we really need to track the three possible open
 states separately.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c
fs/nfs/nfs4state.c