NFSv4: Use the open stateid if the delegation has the wrong mode
Fix nfs4_select_rw_stateid() so that it chooses the open stateid (or an all-zero stateid) if the delegation does not match the selected read/write mode. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
@@ -1024,12 +1024,16 @@ out:
|
||||
|
||||
static int nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state)
|
||||
{
|
||||
const nfs4_stateid *src;
|
||||
int ret;
|
||||
int seq;
|
||||
|
||||
do {
|
||||
src = &zero_stateid;
|
||||
seq = read_seqbegin(&state->seqlock);
|
||||
nfs4_stateid_copy(dst, &state->stateid);
|
||||
if (test_bit(NFS_OPEN_STATE, &state->flags))
|
||||
src = &state->open_stateid;
|
||||
nfs4_stateid_copy(dst, src);
|
||||
ret = 0;
|
||||
smp_rmb();
|
||||
if (!list_empty(&state->owner->so_seqid.list))
|
||||
|
Reference in New Issue
Block a user