Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp863255rwb; Thu, 11 Aug 2022 11:12:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR7LtIK9MWlVc/+WpcEoPqsLYQQi7BD77aALsBpJ5lPLkFVv0n4DcDluYvRnI4Za91j/yBqF X-Received: by 2002:a63:5d4e:0:b0:41d:2966:74e7 with SMTP id o14-20020a635d4e000000b0041d296674e7mr211774pgm.526.1660241553211; Thu, 11 Aug 2022 11:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660241553; cv=none; d=google.com; s=arc-20160816; b=U7URvMVhHSP1yDcBaJ7EfnOieluMnNGA1KxQEcv8miJMuHmTxEyyGG0L3t9k0yn1r/ SSWzd8gVrZgvdo+lO37PbKyUkYRQUTv78MpnfVFj/mbNpJ3JXQy6/+mEx69GJiGuwGWS qNQnhVX3Sj8yXHlBOMCYRixrpAmIaccR3iGNszVvMtc0gSJ6QWdF6EOJ8+6e8h6OcLVq gc9Eo4VzhzgwKGXYuEHQGwOmpdQYy5VY48NyvckYV+ipQGnNLWq/+l1mUKUUweGuW5zU +EheydzJJb6ffy2WJRbdCkH3mPyNFDFUo08bm9sYCXCwMY5TM4E8XmDIehaZFGSj2BZg WzNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ERpZlEJSnT2eqU2XoItuClL1ABvHKuD1I/5qTQERD9g=; b=xhjOEauA1NIB3lZkokWz8WbCJW734l0rRtaMjxJ5YLvdkZBPVIZsLD/X6Pw+Q7GeKu EyAj5SGhEhAfo/BQrkgqv4akfZtyjWZYuANlKn5t7h8qYPtiRyZNXBBX5GbNHxYiMooh JPmesvSPEJZfHjpwqyK+iUN3bKpUNndMAFkyFQ5Vt6GEKnLuqfPKPQXa3pPqXrM1zUAK Er1XDGtib+wk/aWevP/3WaYymVw2Fw3S5BknqJQulF9D06CpbL9bTIkLCYglZVrQxBQA GK2QSsxNFQwV/5VjvnWR+v0xBWKFOumrDGQLB+bnWIzonQfaWQt7jInpWSMvvx3/YSVR kvSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBLDVeVA; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a170903018900b0016bf943aeafsi23911951plg.28.2022.08.11.11.12.18; Thu, 11 Aug 2022 11:12:33 -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=@kernel.org header.s=k20201202 header.b=RBLDVeVA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235659AbiHKRqh (ORCPT + 99 others); Thu, 11 Aug 2022 13:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235193AbiHKRqg (ORCPT ); Thu, 11 Aug 2022 13:46:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DF77A025B; Thu, 11 Aug 2022 10:46:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A87F161746; Thu, 11 Aug 2022 17:46:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15A6EC4347C; Thu, 11 Aug 2022 17:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660239995; bh=ERpZlEJSnT2eqU2XoItuClL1ABvHKuD1I/5qTQERD9g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RBLDVeVA+dt+2L+u5iby39SqxlFaqE82Ch8xUqSvUOY5SvkKe9juEfwHAj/QmsYWI 5Fh363TEuu+p36FUmkpELZvX5i4EEWFzyxWyRpLR5/ONy9qaKdpCQYrb0dJlgvXFgA iPyEjcFP0PL7AGP8jmV09luibvXZfXP2SEH/puyUuzIri9r79mh51savEToIpQNiXY a0XSI6UYv1hzETkhrDc3ciZ4LdWWxvVVjjTGJwcYrIPadOELXd6K3hXQqyx/AaVSef mIZuPN3y73PYa6ws5hhvUbBEKmgcu/NdHMa3HoXwzSsN+dWFe4G2aNZxKGCS7M5h5V Wr0T5ZBA8Ff+A== Received: by mail-yb1-f181.google.com with SMTP id 7so29430682ybw.0; Thu, 11 Aug 2022 10:46:35 -0700 (PDT) X-Gm-Message-State: ACgBeo2hHVsv9P3/DtIDe9BynG/uf7qPykurRKFZ0XJtNsokMeJCZ7zV FnSM56uZxPk8YVtn/HVZwMSPjEsbVMeRSeSNDeg= X-Received: by 2002:a25:2d5b:0:b0:67d:e14:7daa with SMTP id s27-20020a252d5b000000b0067d0e147daamr350929ybe.561.1660239994038; Thu, 11 Aug 2022 10:46:34 -0700 (PDT) MIME-Version: 1.0 References: <20220811171417.147697-1-logang@deltatee.com> <20220811171417.147697-2-logang@deltatee.com> In-Reply-To: <20220811171417.147697-2-logang@deltatee.com> From: Song Liu Date: Thu, 11 Aug 2022 10:46:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] md: Flush workqueue md_rdev_misc_wq in md_alloc() To: Logan Gunthorpe Cc: open list , linux-raid , Christoph Hellwig , Guoqing Jiang , Stephen Bates , Martin Oliveira , David Sloan Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Thu, Aug 11, 2022 at 10:14 AM Logan Gunthorpe wrote: > > From: David Sloan > > A race condition still exists when removing and re-creating md devices > in test cases. However, it is only seen on some setups. > > The race condition was tracked down to a reference still being held > to the kobject by the rdev in the md_rdev_misc_wq which will be released > in rdev_delayed_delete(). > > md_alloc() waits for previous deletions by waiting on the md_misc_wq, > but the md_rdev_misc_wq may still be holding a reference to a recently > removed device. > > To fix this, also flush the md_rdev_misc_wq in md_alloc(). > > Signed-off-by: David Sloan > [logang@deltatee.com: rewrote commit message] > Signed-off-by: Logan Gunthorpe Applied 1/5 to md-fixes. Thanks! Song