From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0154CC10F14 for ; Thu, 10 Oct 2019 09:01:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C354A2190F for ; Thu, 10 Oct 2019 09:01:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570698072; bh=iN0ZoXws2jinrtIFpt62MZAlVZIwWNnzZJfiQf4dWFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DT45EVEKduA9ceRxNh5JRd/wg7Mf1U9JCjgHOp17WID8LAkt3zZ6VJ1Yc043r8VRB GNTP9nrSuiSTLKdmBzb1JPLQyy387FAHKdAA53UrY2zWXWGUWJRoNPVtFivp006/x+ qA9yY5wpwYNZee8xQXoOJ5kmOcXF7EmmgEhqZgE4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388439AbfJJIl6 (ORCPT ); Thu, 10 Oct 2019 04:41:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:46500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387736AbfJJIl6 (ORCPT ); Thu, 10 Oct 2019 04:41:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00E4E2190F; Thu, 10 Oct 2019 08:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696917; bh=iN0ZoXws2jinrtIFpt62MZAlVZIwWNnzZJfiQf4dWFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P/tFJ9PYyI/dr+iEsauRK7f2LXaxBngWlr15ox3IiQYjgmz25nA8J9KDPnqInNIMV +FMmWCyO7cC1k+eKfsXfAzuyiyUiB/5bvvz2Eco+GnGR/JFuFTlyVTm1eKuJkLXuza /wRipueeO9HQ6j0AEU2kcTBL1eId/k9YaWguh3ng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Yan, Zheng" , Jeff Layton , Ilya Dryomov , Sasha Levin Subject: [PATCH 5.3 100/148] ceph: reconnect connection if session hang in opening state Date: Thu, 10 Oct 2019 10:36:01 +0200 Message-Id: <20191010083617.297886056@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Erqi Chen [ Upstream commit 71a228bc8d65900179e37ac309e678f8c523f133 ] 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. Allow ceph_con_keepalive to reconnect a session in OPENING to avoid session hang. Also, ensure that we skip sessions in RESTARTING and REJECTED states since those states can't be resurrected by issuing a keepalive. Link: https://tracker.ceph.com/issues/41551 Signed-off-by: Erqi Chen chenerqi@gmail.com Reviewed-by: "Yan, Zheng" Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- 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 920e9f048bd8f..b11af7d8e8e93 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -4044,7 +4044,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; -- 2.20.1