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>
This commit is contained in:
Trond Myklebust
2006-01-03 09:55:13 +01:00
orang tua cdd4e68b5f
melakukan e761692381
3 mengubah file dengan 42 tambahan dan 28 penghapusan

Melihat File

@@ -182,8 +182,9 @@ struct nfs4_state {
nfs4_stateid stateid;
unsigned int nreaders;
unsigned int nwriters;
unsigned int n_rdonly;
unsigned int n_wronly;
unsigned int n_rdwr;
int state; /* State on the server (R,W, or RW) */
atomic_t count;
};