Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1504633rwn; Thu, 8 Sep 2022 22:18:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Bb8tWe18d6BOv+47v5Q2L3xv6ixGkuRj8NL9aF3jsiC/Zz0UjgyBziN2JMTglEplaQ9rm X-Received: by 2002:a2e:b16c:0:b0:266:175c:cd54 with SMTP id a12-20020a2eb16c000000b00266175ccd54mr3524137ljm.278.1662700731177; Thu, 08 Sep 2022 22:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662700731; cv=none; d=google.com; s=arc-20160816; b=XuQP8P/8DzbKicMGh/uyWNZZb61ZCtTUrrDIvKTNup0YJ+UjuoXRFnZQ8YVuj0q9tq R/lWvonBCG7CgX78kI6d9ydpXIHCjfCO5RmUAOGfEZt20uj5Eb2kdQJsriOqReX1W5o5 YNGOUeS9r/KFoDZkYoeIcq4Y4AP0rYdQ+Iu9njYED96XJXR8FOCTtLmjJu1aJVYNr35h 7cUQTasEfznuMR5IvbT2CRX1IjWn6Kh6Af7fI0eBHvW1O6+wmxQbcg1P16V2PoKwb6ej ca4CYTq6Ga7SwuWFQh/qqBZPg4HASiZCHLui5lnKogdNNcl1XAoJihf+xotoPoL8t5Cm M3qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=9Kk90qlx8Vhsp6XbXukQQLUWaYZ3unCy2EM7YXQuXZM=; b=gCrlsb1oTiDzlwkp9JF2uPpxDZvwzHU1Iz7CEMqs2s80k9qEs6v2ehXc9432CEPPGs gh/mLZIZmQgKLYClw3GTeQs6Gdmzp19J+L6apMb4p03x25PHLaRCZeEzSyxeYb3SRhwj gTMMiWy/TLa7kC2nqOfiAoFaN4qFRFeOLNkJb4Su4uCCKghieNtTa7QhYbVmu2BxVO6J iLnpy6Aagdva7J0GsETiexjhT9NDfpRfXDX9x5T1nVCALuzHvtuwsu0eQXBmJbmUCPpi rg5y4WTsnT6iqONlNI94cXpbNERIwgimXL5YKUWRn1DluBcFdHiLriABhFUE4nqztnac Fa9A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c42-20020a2ebf2a000000b0026be28a536csi437567ljr.96.2022.09.08.22.18.21; Thu, 08 Sep 2022 22:18:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbiIIExm (ORCPT + 99 others); Fri, 9 Sep 2022 00:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230147AbiIIExj (ORCPT ); Fri, 9 Sep 2022 00:53:39 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC11123EE7; Thu, 8 Sep 2022 21:53:38 -0700 (PDT) Received: from [192.168.0.6] (ip5f5aedd0.dynamic.kabel-deutschland.de [95.90.237.208]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 7E82861EA1929; Fri, 9 Sep 2022 06:53:35 +0200 (CEST) Message-ID: <4ccf5784-9e7f-6faf-a710-a97273ebd737@molgen.mpg.de> Date: Fri, 9 Sep 2022 06:53:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v2 2/3] md: Remove extra mddev_get() in md_seq_start() To: Logan Gunthorpe Cc: Song Liu , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, Christoph Hellwig , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan , Christoph Hellwig References: <20220908161516.4361-1-logang@deltatee.com> <20220908161516.4361-3-logang@deltatee.com> Content-Language: en-US From: Paul Menzel In-Reply-To: <20220908161516.4361-3-logang@deltatee.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Logan, Thank you for the updated series. One nit below, which could be corrected by the maintainer before applying. Am 08.09.22 um 18:15 schrieb Logan Gunthorpe: > 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. inadvertently > 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); Kind regards, Paul