diff mbox series

ceph: reconnect connection if session hang in opening state

Message ID 20190910130912.46277-1-chenerqi@gmail.com (mailing list archive)
State New, archived
Headers show
Series ceph: reconnect connection if session hang in opening state | expand

Commit Message

erqi chen Sept. 10, 2019, 1:09 p.m. UTC
From: chenerqi <chenerqi@gmail.com>

If client mds session is evicted in CEPH_MDS_SESSION_OPENING state,
mds won't send session msg to client, and delayed_work skip
CEPH_MDS_SESSION_OPENING state session, the session hang forever.
ceph_con_keepalive reconnct connection for CEPH_MDS_SESSION_OPENING
session to avoid session hang.

Fixes: https://tracker.ceph.com/issues/41551
Signed-off-by: Erqi Chen chenerqi@gmail.com
---
 fs/ceph/mds_client.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Jeffrey Layton Sept. 10, 2019, 1:13 p.m. UTC | #1
On Tue, 2019-09-10 at 21:09 +0800, chenerqi@gmail.com wrote:
> From: chenerqi <chenerqi@gmail.com>
> 
> If client mds session is evicted in CEPH_MDS_SESSION_OPENING state,
> mds won't send session msg to client, and delayed_work skip
> CEPH_MDS_SESSION_OPENING state session, the session hang forever.
> ceph_con_keepalive reconnct connection for CEPH_MDS_SESSION_OPENING
> session to avoid session hang.
> 
> Fixes: https://tracker.ceph.com/issues/41551
> Signed-off-by: Erqi Chen chenerqi@gmail.com
> ---
>  fs/ceph/mds_client.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index 937e887..8f382b5 100644
> --- a/fs/ceph/mds_client.c
> +++ b/fs/ceph/mds_client.c
> @@ -3581,7 +3581,9 @@ static void delayed_work(struct work_struct *work)
>  				pr_info("mds%d hung\n", s->s_mds);
>  			}
>  		}
> -		if (s->s_state < CEPH_MDS_SESSION_OPEN) {
> +		if (s->s_state == CEPH_MDS_SESSION_NEW ||
> +		    s->s_state == CEPH_MDS_SESSION_RESTARTING ||
> +		    s->s_state == CEPH_MDS_SESSION_REJECTED) {
>  			/* this mds is failed or recovering, just wait */
>  			ceph_put_mds_session(s);
>  			continue;

This has already been merged into the testing branch and should make
v5.4. Was there a reason you decided to resend it?
erqi chen Sept. 10, 2019, 1:40 p.m. UTC | #2
Hi,

I made a stupid mistake that "{" is missed at the last of the patch, I
found it just now when I compile the code, please help update it.

Jeff Layton <jlayton@kernel.org> 于2019年9月10日周二 下午9:13写道:
>
> On Tue, 2019-09-10 at 21:09 +0800, chenerqi@gmail.com wrote:
> > From: chenerqi <chenerqi@gmail.com>
> >
> > If client mds session is evicted in CEPH_MDS_SESSION_OPENING state,
> > mds won't send session msg to client, and delayed_work skip
> > CEPH_MDS_SESSION_OPENING state session, the session hang forever.
> > ceph_con_keepalive reconnct connection for CEPH_MDS_SESSION_OPENING
> > session to avoid session hang.
> >
> > Fixes: https://tracker.ceph.com/issues/41551
> > Signed-off-by: Erqi Chen chenerqi@gmail.com
> > ---
> >  fs/ceph/mds_client.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> > index 937e887..8f382b5 100644
> > --- a/fs/ceph/mds_client.c
> > +++ b/fs/ceph/mds_client.c
> > @@ -3581,7 +3581,9 @@ static void delayed_work(struct work_struct *work)
> >                               pr_info("mds%d hung\n", s->s_mds);
> >                       }
> >               }
> > -             if (s->s_state < CEPH_MDS_SESSION_OPEN) {
> > +             if (s->s_state == CEPH_MDS_SESSION_NEW ||
> > +                 s->s_state == CEPH_MDS_SESSION_RESTARTING ||
> > +                 s->s_state == CEPH_MDS_SESSION_REJECTED) {
> >                       /* this mds is failed or recovering, just wait */
> >                       ceph_put_mds_session(s);
> >                       continue;
>
> This has already been merged into the testing branch and should make
> v5.4. Was there a reason you decided to resend it?
> --
> Jeff Layton <jlayton@kernel.org>
>
diff mbox series

Patch

diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 937e887..8f382b5 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -3581,7 +3581,9 @@  static void delayed_work(struct work_struct *work)
 				pr_info("mds%d hung\n", s->s_mds);
 			}
 		}
-		if (s->s_state < CEPH_MDS_SESSION_OPEN) {
+		if (s->s_state == CEPH_MDS_SESSION_NEW ||
+		    s->s_state == CEPH_MDS_SESSION_RESTARTING ||
+		    s->s_state == CEPH_MDS_SESSION_REJECTED) {
 			/* this mds is failed or recovering, just wait */
 			ceph_put_mds_session(s);
 			continue;