git: 0685c73cfe88 - main - nfscl: Add a console message for session recovery

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Sun, 28 Aug 2022 21:25:40 UTC
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=0685c73cfe88b94d60b1b2ddfdb36c684a008006

commit 0685c73cfe88b94d60b1b2ddfdb36c684a008006
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-08-28 21:24:39 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-08-28 21:24:39 +0000

    nfscl: Add a console message for session recovery
    
    The NFSv4.1/4.2 client does recovery when it receives a
    NFSERR_BADSESSION reply from the server.  If the server has
    not rebooted, this is often caused by multiple clients using
    the same /etc/hostid and, as such, not being recognized as
    different clients by the server.
    
    This trivial patch adds a console message to suggest that
    client's /etc/hostid's need to be checked for uniqueness.
    
    MFC after:      2 weeks
---
 sys/fs/nfs/nfs_commonkrpc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/fs/nfs/nfs_commonkrpc.c b/sys/fs/nfs/nfs_commonkrpc.c
index 91ebd84fabd0..9badd8be47d4 100644
--- a/sys/fs/nfs/nfs_commonkrpc.c
+++ b/sys/fs/nfs/nfs_commonkrpc.c
@@ -1131,6 +1131,10 @@ tryagain:
 				sep = NFSMNT_MDSSESSION(nmp);
 				if (bcmp(sep->nfsess_sessionid, nd->nd_sequence,
 				    NFSX_V4SESSIONID) == 0) {
+					printf("Initiate recovery. If server "
+					    "has not rebooted, "
+					    "check NFS clients for unique "
+					    "/etc/hostid's\n");
 					/* Initiate recovery. */
 					sep->nfsess_defunct = 1;
 					NFSCL_DEBUG(1, "Marked defunct\n");