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

Message ID 20200717132513.8845-1-xiubli@redhat.com
State New
Headers show
Series
  • ceph: check the sesion state and return false in case it is closed
Related show

Commit Message

Xiubo Li July 17, 2020, 1:25 p.m. UTC
From: Xiubo Li <xiubli@redhat.com>

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

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/mds_client.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jeff Layton July 17, 2020, 1:32 p.m. UTC | #1
On Fri, 2020-07-17 at 09:25 -0400, xiubli@redhat.com wrote:
> From: Xiubo Li <xiubli@redhat.com>
> 
> If the session is already in closed state, we should skip it.
> 
> Signed-off-by: Xiubo Li <xiubli@redhat.com>
> ---
>  fs/ceph/mds_client.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 887874f8ad2c..2af773168a0a 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -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!
Xiubo Li July 17, 2020, 1:32 p.m. UTC | #2
On 2020/7/17 21:32, Jeff Layton wrote:
> On Fri, 2020-07-17 at 09:25 -0400, xiubli@redhat.com wrote:
>> From: Xiubo Li <xiubli@redhat.com>
>>
>> If the session is already in closed state, we should skip it.
>>
>> Signed-off-by: Xiubo Li <xiubli@redhat.com>
>> ---
>>   fs/ceph/mds_client.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
>> index 887874f8ad2c..2af773168a0a 100644
>> --- a/fs/ceph/mds_client.c
>> +++ b/fs/ceph/mds_client.c
>> @@ -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.


> Thanks!

Patch
diff mbox series

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 887874f8ad2c..2af773168a0a 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -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;