Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2076726ybp; Thu, 10 Oct 2019 01:46:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz4O9RA+wppVha/Q+1zDDzaAeApgkWjPJAiXaJkuJ03BdSE/xuPLWpnBOnjLXsvtVFj1dK X-Received: by 2002:a17:906:134a:: with SMTP id x10mr7050537ejb.204.1570697167777; Thu, 10 Oct 2019 01:46:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570697167; cv=none; d=google.com; s=arc-20160816; b=aeJfugurL2MTYKZ6ZH4BJInSALXFtWEHt74JET9gXTyOdS+cvnCb/8EsJ4SbEIS1ei 2u8oEESwWULy5yPXr2D+RuM/FZHFljm1rYGEfEs9/jAR4xYrEMqv0WIMUovFzJOwFfKm 0gSMWO1dvauYIP0vvUpELF2ezKFjE6vczdfBre0oRXLL4orA8QBAduhZVf9tOVqVRwsK YLU5OLi+fUejffextHvkOMg59G9tvZLBo1z6MJcuQ4pUZ2AAMIoB2gjmS7VKFt80QuBJ jfV8dlcumxXQsBs0gau+i7M5ZG2w7swwxhfqqnLOWJA3sLiYaqMMqQ5moJGftje6vdK3 w7wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ltnVK25e/q3yYQbIcBA3x46FJ8msY93dupX57DCvKrQ=; b=Af5BnNiTs79S8M1jJecPtw0NMPwyMxfZz/ErQFGWRt5ivyqpUtYEiPtlQrLo8INZh6 SjvFI6rFw9WfcCSsk5dArxLmk0tQdKiXFvZC9QVd2JFCEx5uJn8Ju/EPBrSiHlzOJZeT iVa3tL8bY0QCvkOwyuxcQLUOdWk9RndbbO7tylQnWKsUWPpTyUD7EqHiwHn6gys38F0I 5rviHYj1ZFMoq4Ieagdhu/7lru22mHY31zxRRNfzVGHGvTR0g21hE3ot2QMWtUUpuYz5 RNW7eIIwMJpKvcFYBRtAtf72OXf9e1hJ7aDxZtQafGppHsXWWvX62/Q2kTW/tnTpUWGE VQ7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P/tFJ9PY"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si3240179edc.231.2019.10.10.01.45.43; Thu, 10 Oct 2019 01:46:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="P/tFJ9PY"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388459AbfJJImB (ORCPT + 99 others); Thu, 10 Oct 2019 04:42:01 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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