Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp80147rwb; Fri, 2 Sep 2022 10:28:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5/BA9JV394SZ8cBwYD7hARbTLMYWQ5rpWWn6YedAQg89e455KSLh0RBNnQk3tuEqowJ3Ss X-Received: by 2002:a17:90b:212:b0:1fd:e61b:866a with SMTP id fy18-20020a17090b021200b001fde61b866amr5785628pjb.141.1662139729810; Fri, 02 Sep 2022 10:28:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662139729; cv=none; d=google.com; s=arc-20160816; b=kevJRVvBlkAVuNq25qPiQA7KuynZpN+sVlrLnly8/ohYZsToPlXmSiT0g4INgbBGvf 0nxa8DFoEY/WEohQw/egi18HfHRuQdeEnyqoUf9azqmoiitri5fPBTKrThjbyW3YYDMe fPp65WVo3FeX0uNPXRoJ0K5bmaGumcKi83tkIGEeAqe4V0hAiKTVRJiYAJDlFo7bvGlU 5hM5VU3InaaNLabVMv/uXn+S8LlALt1i0gLi5sTCn2ZjyHomOzpx4ccVB1aMR1/9xyiw gwV/lSKcFDzZJmoX7S0BxXA5Nhq8B/Fh7dAmiLEYFmvFXWoAlUKifbD5XKzfTibkmD+9 Dzdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=UtIc2s5DOuFL/LiP/yVuzjVDm/kIIglMbjnjGz9/+n0=; b=w0qfyjGTX8FlsRid/Gm5DzTNBpsM3vyO8fmqYwynHCDyeN3YobK9fSKs4i1Yf8raHZ +ufi1J3mh8vrLpGLMTtwxw/n6MVY1tcSMJw1tqhjvxy/MhirnTEuAT7MADPAOQwObvQe vMiwTx/8Ga/7gerLVNrTXOQkSuw+lkHwXDrWAz9b5+ocv15YYxKAUzag9XdJFS74m8ut kvSfZVWe1xXPyBjUiWGPBf6V3FxyUHj+AOcjHg283OEhcKet18E10c7AVXPq8euuKujw Y1ceZyt08ac5tl1CYbuK68f+aB7c7a7AdMkrhUBPlUnHwBckKUpVnAjLSwx6fe6IDly+ S8Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=PEb7B8vh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l27-20020a63ba5b000000b0042a49af1347si2977168pgu.563.2022.09.02.10.28.38; Fri, 02 Sep 2022 10:28:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=PEb7B8vh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deltatee.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236669AbiIBRQY (ORCPT + 99 others); Fri, 2 Sep 2022 13:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235697AbiIBRQS (ORCPT ); Fri, 2 Sep 2022 13:16:18 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C8BEEA8B6; Fri, 2 Sep 2022 10:16:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:MIME-Version:References:In-Reply-To: Message-Id:Date:Cc:To:From:content-disposition; bh=UtIc2s5DOuFL/LiP/yVuzjVDm/kIIglMbjnjGz9/+n0=; b=PEb7B8vhw5w852popqsgrKAW+y /q2RnK/f7LzokRm1wXH/sZyIUlG9G/PAsR7E+DOdCEw1XYXXq1mPrBn/e9YWC6Zt55bN2n9PLKrlY XytEHpp/oyAFH6/e8gYhaLfOxXvTyrxGEOZqQKYENrBZvPk1eE5DwtlB/QqqzZOROpoWBJ7l8gdlr vNBAM19FELnj75Oud/REMqjQCrCm1X7qfGYEkEaezmJdnia0BRbbPozlLt3rAo/8iStRWW0BDB2Zo CCoWMBCe9cTrYAgV1mhS/917VZMf0wtqs5PF/zJ58oiqDYC0D49O002kYvKursj+N1Z7S5wJNAUTX vYFlSNAQ==; Received: from cgy1-donard.priv.deltatee.com ([172.16.1.31]) by ale.deltatee.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oUAH8-00Ejng-GV; Fri, 02 Sep 2022 11:16:15 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1oUAH7-00065w-1j; Fri, 02 Sep 2022 11:16:13 -0600 From: Logan Gunthorpe To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Song Liu Cc: Christoph Hellwig , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan , Logan Gunthorpe Date: Fri, 2 Sep 2022 11:16:09 -0600 Message-Id: <20220902171609.23376-3-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220902171609.23376-1-logang@deltatee.com> References: <20220902171609.23376-1-logang@deltatee.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.31 X-SA-Exim-Rcpt-To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, song@kernel.org, hch@infradead.org, guoqing.jiang@linux.dev, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com X-SA-Exim-Mail-From: gunthorp@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH 2/2] md: Remove extra mddev_get() in md_seq_start() X-SA-Exim-Version: 4.2.1 (built Sat, 13 Feb 2021 17:57:42 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A regression is seen where mddev devices stay permanently after they are stopped due to an elevated reference count. This was tracked down to an extra mddev_get() in md_seq_start(). It only happened rarely because most of the time the md_seq_start() is called with a zero offset. The path with an extra mddev_get() only happens when it starts with a non-zero offset. The commit noted below changed an mddev_get() to check its success but inadevrtantly left the original call in. Remove the extra call. Fixes: 12a6caf27324 ("md: only delete entries from all_mddevs when the disk is freed") Signed-off-by: Logan Gunthorpe --- drivers/md/md.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index afaf36b2f6ab..9dc0175280b4 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8154,7 +8154,6 @@ static void *md_seq_start(struct seq_file *seq, loff_t *pos) list_for_each(tmp,&all_mddevs) if (!l--) { mddev = list_entry(tmp, struct mddev, all_mddevs); - mddev_get(mddev); if (!mddev_get(mddev)) continue; spin_unlock(&all_mddevs_lock); -- 2.30.2