Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp829274rwn; Thu, 8 Sep 2022 09:17:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7D2t9osJyS1vuZrL6VAzEl+YGvErGe9gN1TKRnqKKatTy5o8tCjNrqQk6ZFQn5qLEKyccf X-Received: by 2002:a63:7f0c:0:b0:434:5711:7cb6 with SMTP id a12-20020a637f0c000000b0043457117cb6mr8569724pgd.8.1662653872868; Thu, 08 Sep 2022 09:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662653872; cv=none; d=google.com; s=arc-20160816; b=ljvKQcGXzwCJJebhZiuh+Vev78vbpLm+WaIEW3lNsl0gomKUyRazUQED9IHT23YoJg W9oSnOIPbka5bkLsmuwDJnSFxvarSoNHuAlbDSaRmaZu6mxBQVFKqGI7Cl0t/m6XZgzv NsVlElwAiGv3Wt9ow53NHdXMkESUy2dLl1kkeDUnxbzbDaP76phLwDN4Bosonys3P0M9 9GiZYGTatRFFpOw0Hx//GmImX9ZBfBux/9spSXfUxBlS4snS+tz2oFUPHvCfOe5mwglR jdDg3UsBMQNx4qtt+fkXkAElzWbcc2EOiPRUfen5iM/zXUfUqR+nu6zmGSKlski23UMF O+ow== 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=yypPU1IxV0SG3MDtollNVAvP34loykQUhcCgU32lefk=; b=e3z7F9GAQ4BQI9wq7VyO2iJcEHS93fcLOHT734DgkP/ad3NMRsxshINO+GVrTKEuLc bTroAcg2gNfCLCmTbLwKaHGl7j4ZSk5+ONs76X7MDrFMKn1gj8X8vJqwDSWXWlqKnjO+ x0OIKCgKIzK1wLsk2mOE3cULvN4PDBNkN0HWkdlzYzVyEEjRhLAK/pfbFA/vPp9VDX1Z PMGe4QqxnpquTbrnCv1kchOzJ4w7Q4QxlmnddKXxGnYzp/NeBUrANDYbkAH7JapJTHcD c98jHjInsjzFQF/eZ5VYNU0M3ldXzvNZQkbdFYmAV7DEe85qRnU4Ic5h2L4BBMMcUxhD 6KEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deltatee.com header.s=20200525 header.b=jNuOJ57j; 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 z3-20020a170902708300b0017123d2abd5si1651967plk.457.2022.09.08.09.17.38; Thu, 08 Sep 2022 09:17:52 -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=jNuOJ57j; 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 S231639AbiIHQQX (ORCPT + 99 others); Thu, 8 Sep 2022 12:16:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232021AbiIHQPn (ORCPT ); Thu, 8 Sep 2022 12:15:43 -0400 Received: from ale.deltatee.com (ale.deltatee.com [204.191.154.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD78A14D0F; Thu, 8 Sep 2022 09:15:25 -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=yypPU1IxV0SG3MDtollNVAvP34loykQUhcCgU32lefk=; b=jNuOJ57jy3LdCqgpX/HqPM68qz OT/YXMtTucTfBSMypX3X93FURdCt+XB6gcHRnw92V1kGrbcsgU2Z5UDNS1frydXzc0g1g0Q6TMhrf pJXzPuv5lTtRH9NSIg1DwHMJky7eGpqtuyGwDdAxuR3SBW1kpJOABAiGihqpNZKvxGlZZ+fbBINiK LFcDJSObcr42lXEdEvaRLsO7ZOx8rI2PQ8GU6t3arCyHd91zBwnsXCdUzSSVDq7Un+JydCyAJ3oo9 8NWa1C8zZCZ0UIqHjFzn2SoVnV2vNdYNTqe5vvK1BEhZrqtxspRWFeQ4GK25Uz+W7AV/QPWNlRkqk Hz2ZtriA==; 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 1oWKBW-001jK0-RD; Thu, 08 Sep 2022 10:15:24 -0600 Received: from gunthorp by cgy1-donard.priv.deltatee.com with local (Exim 4.94.2) (envelope-from ) id 1oWKBU-00019G-L9; Thu, 08 Sep 2022 10:15:20 -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 , Christoph Hellwig , Guoqing Jiang Date: Thu, 8 Sep 2022 10:15:15 -0600 Message-Id: <20220908161516.4361-3-logang@deltatee.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220908161516.4361-1-logang@deltatee.com> References: <20220908161516.4361-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, sbates@raithlin.com, Martin.Oliveira@eideticom.com, David.Sloan@eideticom.com, logang@deltatee.com, hch@lst.de, guoqing.jiang@linux.dev, Guoqing.jiang@linux.dev 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 v2 2/3] 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 Reviewed-by: Christoph Hellwig Acked-by: Guoqing Jiang --- 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