Commit 9c47b18c authored by Trond Myklebust's avatar Trond Myklebust Committed by Anna Schumaker

pNFS: Ensure we do clear the return-on-close layout stateid on fatal errors

IF the server rejected our layout return with a state error such as
NFS4ERR_BAD_STATEID, or even a stale inode error, then we do want
to clear out all the remaining layout segments and mark that stateid
as invalid.

Fixes: 1c5bd76d ("pNFS: Enable layoutreturn operation for...")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 581057c8
...@@ -1449,10 +1449,15 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args, ...@@ -1449,10 +1449,15 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
const nfs4_stateid *res_stateid = NULL; const nfs4_stateid *res_stateid = NULL;
struct nfs4_xdr_opaque_data *ld_private = args->ld_private; struct nfs4_xdr_opaque_data *ld_private = args->ld_private;
if (ret == 0) { switch (ret) {
arg_stateid = &args->stateid; case -NFS4ERR_NOMATCHING_LAYOUT:
break;
case 0:
if (res->lrs_present) if (res->lrs_present)
res_stateid = &res->stateid; res_stateid = &res->stateid;
/* Fallthrough */
default:
arg_stateid = &args->stateid;
} }
pnfs_layoutreturn_free_lsegs(lo, arg_stateid, &args->range, pnfs_layoutreturn_free_lsegs(lo, arg_stateid, &args->range,
res_stateid); res_stateid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment