Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp83831rwd; Wed, 7 Jun 2023 19:55:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GYFr1+tH4AvdcHGfPX81Py+LRPYCt8ybWeABXxR1eIXdtUIi4oGi6ur7NQ6aAr2IEkYNC X-Received: by 2002:a92:4a12:0:b0:33b:2a78:fbec with SMTP id m18-20020a924a12000000b0033b2a78fbecmr5650322ilf.28.1686192925119; Wed, 07 Jun 2023 19:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686192925; cv=none; d=google.com; s=arc-20160816; b=PKYWaEK49c6mqCkKp0bhjPVksG98JnR6mpkME8/OLqba1GoIHQRBuVxZVC/97EQZrN csHWA5QUbHsfWjmYZZj2aumUBnzUFKGWEIGe5RShFka4NbJl9l5cLFJUxuDzHh2bv34C CYvkqR0Tibzc+olk6q4VXyPi3W6IXqbyX0ESPPmzFgGWZF8U5eig0MKUOxANPQggHHX0 ky/gP4amggNIerJ9bp7BI/3WQ2kI2Rpns/Yx+DE/iQq+7dJXGPLLLTlMT1wbwghNdZw4 blvAp437H2SqeOiYyqxEqGoK6JGXJkmAhfpfdsagYGNspejxNKFWM4IJy2HdEbSNaEZK bU8w== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=cmq6UdBIuS0IupKmN/71JaowhfCZF7uX2tdIlPge3Oc=; b=nx+HuL2RNcfwsODfXARusSIM5aIOdzcxZ1F3Ov4R1ntWChFLf1pSIp3l3AbHtck9sF CZZlfSS3XBUWnCzyRJ2fW9eFk5TDzyUYvSs+1mULBpkqHrdhH5oIUYd+fi0QAMk0VUYL uhA7Gw8G5K29TP4IjwjjZO3cfZz6PIRrqjlbUX/e+Jk7wHRR9XRDe1VL/6jYP3t1CPle RkdbOiyOyfNewiVCdICs9WfmWTyvvO7bYHnbzXy76Djs7z9M8ua6QLs0rxRgWTZ3gcwz GXDuIbjvstI7vIW+Y/yjgv0IxCBt6hBGYxSHxXct+cYii7Ss4Hbg9Ol0Y/FKnTa0tq1T 4m7g== 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 g63-20020a636b42000000b005302f7ebd3esi218919pgc.800.2023.06.07.19.55.00; Wed, 07 Jun 2023 19:55:25 -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 S233594AbjFHClZ (ORCPT + 99 others); Wed, 7 Jun 2023 22:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231698AbjFHClW (ORCPT ); Wed, 7 Jun 2023 22:41:22 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB5A226A5; Wed, 7 Jun 2023 19:41:05 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Qc7kP4wNMz4f3jYv; Thu, 8 Jun 2023 10:41:01 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP4 (Coremail) with SMTP id gCh0CgBH_rG9P4FkzBfHLA--.54104S3; Thu, 08 Jun 2023 10:41:02 +0800 (CST) Subject: Re: [PATCH -next v2 0/6] md: fix that MD_RECOVERY_RUNNING can be cleared while sync_thread is still running To: Yu Kuai , guoqing.jiang@linux.dev, agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, song@kernel.org Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yi.zhang@huawei.com, yangerkun@huawei.com, "yukuai (C)" References: <20230529132037.2124527-1-yukuai1@huaweicloud.com> From: Yu Kuai Message-ID: <0a38ddc1-b47e-04e8-dbf5-25afcd13fff4@huaweicloud.com> Date: Thu, 8 Jun 2023 10:41:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20230529132037.2124527-1-yukuai1@huaweicloud.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgBH_rG9P4FkzBfHLA--.54104S3 X-Coremail-Antispam: 1UD129KBjvdXoW7GrWktr43Kr17Ww1fAFy3XFb_yoWkWFg_Wa 4YkFy3Wr47GF15GFyDKrn8Z39rGFW5ur1DXFyrtayjvFyIgrnxCr1kuw43uw1YvFWjyr18 ArWUCayfAwsrWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb3xFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s 0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xII jxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr 1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2IY 04v7Mxk0xIA0c2IEe2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7 v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF 1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIx AIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVW3JVWrJr1l IxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvf C2KfnxnUUI43ZEXa7VU1a9aPUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, MAY_BE_FORGED,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,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 Hi, ?? 2023/05/29 21:20, Yu Kuai ะด??: > From: Yu Kuai > > Changes in v2: > - rebase for the latest md-next > > Patch 1 revert the commit because it will cause MD_RECOVERY_RUNNING to be > cleared while sync_thread is still running. The deadlock this patch tries > to fix will be fixed by patch 2-5. > > Patch 6 enhance checking to prevent MD_RECOVERY_RUNNING to be cleared > while sync_thread is still running. Any suggestions on this patchset? I already sent regression test for the deadlock problem for both raid10 and raid456. Thanks, Kuai > > Yu Kuai (6): > Revert "md: unlock mddev before reap sync_thread in action_store" > md: refactor action_store() for 'idle' and 'frozen' > md: add a mutex to synchronize idle and frozen in action_store() > md: refactor idle/frozen_sync_thread() to fix deadlock > md: wake up 'resync_wait' at last in md_reap_sync_thread() > md: enhance checking in md_check_recovery() > > drivers/md/dm-raid.c | 1 - > drivers/md/md.c | 124 +++++++++++++++++++++++++++++-------------- > drivers/md/md.h | 5 ++ > 3 files changed, 88 insertions(+), 42 deletions(-) >