Skip to content

Commit 1f0a6b3

Browse files
trondmypdamschuma-ntap
authored andcommitted
NFSv4: Add support for OPEN4_RESULT_NO_OPEN_STATEID
If the server returns a delegation stateid only, then don't try to set an open stateid. Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Lance Shelton <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent d2a00cc commit 1f0a6b3

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

fs/nfs/nfs4proc.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,8 +2035,11 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
20352035
data->o_arg.claim,
20362036
&data->o_res.delegation);
20372037

2038-
if (!update_open_stateid(state, &data->o_res.stateid,
2039-
NULL, data->o_arg.fmode))
2038+
if (!(data->o_res.rflags & NFS4_OPEN_RESULT_NO_OPEN_STATEID)) {
2039+
if (!update_open_stateid(state, &data->o_res.stateid,
2040+
NULL, data->o_arg.fmode))
2041+
return ERR_PTR(-EAGAIN);
2042+
} else if (!update_open_stateid(state, NULL, NULL, data->o_arg.fmode))
20402043
return ERR_PTR(-EAGAIN);
20412044
refcount_inc(&state->count);
20422045

@@ -2105,8 +2108,13 @@ _nfs4_opendata_to_nfs4_state(struct nfs4_opendata *data)
21052108
data->o_arg.claim,
21062109
&data->o_res.delegation);
21072110

2108-
if (!update_open_stateid(state, &data->o_res.stateid,
2109-
NULL, data->o_arg.fmode)) {
2111+
if (!(data->o_res.rflags & NFS4_OPEN_RESULT_NO_OPEN_STATEID)) {
2112+
if (!update_open_stateid(state, &data->o_res.stateid,
2113+
NULL, data->o_arg.fmode)) {
2114+
nfs4_put_open_state(state);
2115+
state = ERR_PTR(-EAGAIN);
2116+
}
2117+
} else if (!update_open_stateid(state, NULL, NULL, data->o_arg.fmode)) {
21102118
nfs4_put_open_state(state);
21112119
state = ERR_PTR(-EAGAIN);
21122120
}

0 commit comments

Comments
 (0)