[PATCH 3/3] nfs41: pass state recovery error back to caller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently the error returned from create_session to the state manager
is recorded in cl_cons_state via nfs_mark_client_ready
but it is ignored by nfs4_check_client_ready and mis-translated to
-EPROTONOSUPPORT if the client has a session.

Fixes https://bugzilla.linux-nfs.org/show_bug.cgi?id=178

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
Cc: Andy Adamson <andros@xxxxxxxxxx>
---
 fs/nfs/client.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 157a1d9..b3f8307 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -536,16 +536,11 @@ void nfs_mark_client_ready(struct nfs_client *clp, int state)
 /*
  * With sessions, the client is not marked ready until after a
  * successful EXCHANGE_ID and CREATE_SESSION.
- *
- * Map errors cl_cons_state errors to EPROTONOSUPPORT to indicate
- * other versions of NFS can be tried.
  */
 int nfs4_check_client_ready(struct nfs_client *clp)
 {
-	if (!nfs4_has_session(clp))
-		return 0;
-	if (clp->cl_cons_state < NFS_CS_READY)
-		return -EPROTONOSUPPORT;
+	if (clp->cl_cons_state < 0)
+		return clp->cl_cons_state;
 	return 0;
 }
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux