Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3718269pxv; Mon, 26 Jul 2021 10:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztUzzWLwVfuISnW/czUPrdF0VRkSe0xDZpoMJow46gyybeG03vJIqllOhDsB6S5kC49GWg X-Received: by 2002:a05:6402:22e9:: with SMTP id dn9mr1919271edb.218.1627319350164; Mon, 26 Jul 2021 10:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627319350; cv=none; d=google.com; s=arc-20160816; b=IMX9LMvrqAaPs1LKx9/2iExDz4tFlss5aHe8wb/pnBkpZxmClaqwQfMuMpp2w4hYsl jOsVHBPnKPzglWEqt3Lf9NvMYfLOcT7AUD+LO9GHsrOuenkSugQQnwWkjeyu8ZR97uZT WCPZVsI33tEccUVtDGm0glMDzgyaHj5ESGbYg7P4FPKgQTVoRni35YsEqp0Vk16Gw/1W rdWTnAKMQubvmyki7AX1KKE8EbYyGnrR5mB42+qCkF+iWclBuFvvR2nkbE7npcZ+OXOI SDobWB65EGyBEUAAq1MVlzZvqj1R0gEJUGXLdQenyA1RGhU3EzG85zEL/7/aPMvO6qT/ 1hVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LAX9PjMu7ICJUFCXG4UepVF6qc/z3g8xoWvfRKukFOE=; b=xJSGjp0DRUfQOykm1wmbGadUVbVE15VOeumOnQ77kloagenxizf9vdS/xO7cGPTYTS ug/GHj29mhjoudb+cMwFqF5ReBOmzzDZy/5vANUOzD0Rh1Rm4vr2qi9uk/902R0eIipP 9GIZKBmMIiF+WX/L9m57url6cLY9qxhgxE8F6qmel1SpLbIylEQciTRAIdguC0WlsGcc aAIK67muk9XUq9ig4yxw7Y03xsfBUyIWwqd7RXxcgcqkml6MUrixw8xXrjT6r33C6XN0 MvZqriVRuLrM4yi2zzMS/3703N5hMGvg9rtjHjKEuz6sMB044SHvDjNVGDzneyWoPGEZ f+PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G2wzVuze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi14si410147ejb.441.2021.07.26.10.08.42; Mon, 26 Jul 2021 10:09:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G2wzVuze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237947AbhGZPkx (ORCPT + 99 others); Mon, 26 Jul 2021 11:40:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237529AbhGZPXS (ORCPT ); Mon, 26 Jul 2021 11:23:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D60B360EB2; Mon, 26 Jul 2021 16:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315427; bh=EbI8xoAF1Uc9GQwcULMt9iXYokM+w/UwDs8a6JaKhQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G2wzVuzeWX/NwyZ16G/8dLiCW66Q6VkTxl2NaQpOZsldiaFcscMPDZN7POkhPFk3c //VvCQ18ZhLtbX4xQzQH3Bqsg/V60yTk0ZwbnIAAOSGRiiMku8eOvtV9SFZu/BYrDJ 07edQZQ22CJM7iLqobJZCxrdlcw5MkkINx+SeTHU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luis Henriques , Jeff Layton , Ilya Dryomov , Sasha Levin Subject: [PATCH 5.10 092/167] ceph: dont WARN if were still opening a session to an MDS Date: Mon, 26 Jul 2021 17:38:45 +0200 Message-Id: <20210726153842.485284159@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153839.371771838@linuxfoundation.org> References: <20210726153839.371771838@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luis Henriques [ Upstream commit cdb330f4b41ab55feb35487729e883c9e08b8a54 ] If MDSs aren't available while mounting a filesystem, the session state will transition from SESSION_OPENING to SESSION_CLOSING. And in that scenario check_session_state() will be called from delayed_work() and trigger this WARN. Avoid this by only WARNing after a session has already been established (i.e., the s_ttl will be different from 0). Fixes: 62575e270f66 ("ceph: check session state after bumping session->s_seq") Signed-off-by: Luis Henriques Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov Signed-off-by: Sasha Levin --- fs/ceph/mds_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index d560752b764d..6b00f1d7c8e7 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -4401,7 +4401,7 @@ bool check_session_state(struct ceph_mds_session *s) break; case CEPH_MDS_SESSION_CLOSING: /* Should never reach this when we're unmounting */ - WARN_ON_ONCE(true); + WARN_ON_ONCE(s->s_ttl); fallthrough; case CEPH_MDS_SESSION_NEW: case CEPH_MDS_SESSION_RESTARTING: -- 2.30.2