Skip to content

Commit 6a518da

Browse files
author
Olga Kornievskaia
committed
NFSv4/pnfs: Layoutreturn on close must handle fatal networking errors
JIRA: https://issues.redhat.com/browse/RHEL-102164 commit 440caf8 Author: Trond Myklebust <trond.myklebust@hammerspace.com> Date: Sun Apr 6 11:05:27 2025 +0200 NFSv4/pnfs: Layoutreturn on close must handle fatal networking errors If we have a fatal ENETDOWN or ENETUNREACH error, then the layoutreturn on close code should also handle that as fatal, and free the layouts. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
1 parent 086d284 commit 6a518da

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

fs/nfs/pnfs.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,6 +1661,18 @@ int pnfs_roc_done(struct rpc_task *task, struct nfs4_layoutreturn_args **argpp,
16611661
/* Was there an RPC level error? If not, retry */
16621662
if (task->tk_rpc_status == 0)
16631663
break;
1664+
/*
1665+
* Is there a fatal network level error?
1666+
* If so release the layout, but flag the error.
1667+
*/
1668+
if ((task->tk_rpc_status == -ENETDOWN ||
1669+
task->tk_rpc_status == -ENETUNREACH) &&
1670+
task->tk_flags & RPC_TASK_NETUNREACH_FATAL) {
1671+
*ret = 0;
1672+
(*respp)->lrs_present = 0;
1673+
retval = -EIO;
1674+
break;
1675+
}
16641676
/* If the call was not sent, let caller handle it */
16651677
if (!RPC_WAS_SENT(task))
16661678
return 0;

0 commit comments

Comments
 (0)