Skip to contentSkip to conversation

ceph: check the sesion state and return false in case it is closed

PATCH In review [email protected] 2 participants 3 messages Jul 17, 2020 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: check the sesion state and return false in case it is closed

From: Xiubo Li <[email protected]>

If the session is already in closed state, we should skip it.

---
 fs/ceph/mds_client.c | 1 +
 1 file changed, 1 insertion(+)
fs/ceph/mds_client.c +1 -0
index 887874f8ad2c..2af773168a0a 100644
@@ -4302,6 +4302,7 @@ bool check_session_state(struct ceph_mds_session *s)
 	}
 	if (s->s_state == CEPH_MDS_SESSION_NEW ||
 	    s->s_state == CEPH_MDS_SESSION_RESTARTING ||
+	    s->s_state == CEPH_MDS_SESSION_CLOSED ||
 	    s->s_state == CEPH_MDS_SESSION_REJECTED)
 		/* this mds is failed or recovering, just wait */
 		return false;
Signature · 1 line
2.27.0.221.ga08a83d.dirty
#1 lore raw
Quoted 14 lines · On Fri, 2020-07-17 at 09:25 -0400, [email protected] wrote:

From: Xiubo Li <[email protected]>

If the session is already in closed state, we should skip it.

---
 fs/ceph/mds_client.c | 1 +
 1 file changed, 1 insertion(+)
fs/ceph/mds_client.c +0 -0
index 887874f8ad2c..2af773168a0a 100644

fs/ceph/mds_client.c bool check_session_state(struct ceph_mds_session *s) · line 4308

Quoted 7 lines
fs/ceph/mds_client.c +1 -0
@@ -4302,6 +4302,7 @@ bool check_session_state(struct ceph_mds_session *s)
 	}
 	if (s->s_state == CEPH_MDS_SESSION_NEW ||
 	    s->s_state == CEPH_MDS_SESSION_RESTARTING ||
+	    s->s_state == CEPH_MDS_SESSION_CLOSED ||
 	    s->s_state == CEPH_MDS_SESSION_REJECTED)
 		/* this mds is failed or recovering, just wait */
 		return false;

Looks good. I merged this into testing and rebased the metrics patches on top.

Thanks!

Signature · 1 line
Jeff Layton <[email protected]>
author
#2 lore raw
Quoted 10 lines · Jeff Layton
Quoted 9 lines · On Fri, 2020-07-17 at 09:25 -0400, [email protected] wrote:

From: Xiubo Li <[email protected]>

If the session is already in closed state, we should skip it.

---
  fs/ceph/mds_client.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 14 lines

fs/ceph/mds_client.c bool check_session_state(struct ceph_mds_session *s) · line 4308

Quoted 12 lines
fs/ceph/mds_client.c +1 -0
index 887874f8ad2c..2af773168a0a 100644
@@ -4302,6 +4302,7 @@ bool check_session_state(struct ceph_mds_session *s)
  	}
  	if (s->s_state == CEPH_MDS_SESSION_NEW ||
  	    s->s_state == CEPH_MDS_SESSION_RESTARTING ||
+	    s->s_state == CEPH_MDS_SESSION_CLOSED ||
  	    s->s_state == CEPH_MDS_SESSION_REJECTED)
  		/* this mds is failed or recovering, just wait */
  		return false;

Looks good. I merged this into testing and rebased the metrics patches on top.

Thanks Jeff.

Quoted 1 line

Thanks!