Skip to content

Commit 0af5fb5

Browse files
author
Trond Myklebust
committed
NFSv4: Treat ENETUNREACH errors as fatal for state recovery
If a containerised process is killed and causes an ENETUNREACH or ENETDOWN error to be propagated to the state manager, then mark the nfs_client as being dead so that we don't loop in functions that are expecting recovery to succeed. Reviewed-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent c81d5bc commit 0af5fb5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/nfs/nfs4state.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,15 @@ static void nfs4_state_manager(struct nfs_client *clp)
27392739
pr_warn_ratelimited("NFS: state manager%s%s failed on NFSv4 server %s"
27402740
" with error %d\n", section_sep, section,
27412741
clp->cl_hostname, -status);
2742-
ssleep(1);
2742+
switch (status) {
2743+
case -ENETDOWN:
2744+
case -ENETUNREACH:
2745+
nfs_mark_client_ready(clp, -EIO);
2746+
break;
2747+
default:
2748+
ssleep(1);
2749+
break;
2750+
}
27432751
out_drain:
27442752
memalloc_nofs_restore(memflags);
27452753
nfs4_end_drain_session(clp);

0 commit comments

Comments
 (0)