Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp232025lqs; Mon, 4 Mar 2024 23:29:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWhggRoR2slnYQLO/1+wGzU1IX88uIVZ9hPJBS93uj975ZuOaWoX8xMFd4RDppyJqtNK94S+DaePcKJbLBHVUVD0TZgavpIeTBKEiDSaQ== X-Google-Smtp-Source: AGHT+IHCGoESJVTugkRWh5xC69uqqEj6b5/OwxUKs191fN0BFwk4jgY29tQAh3P50wbwOOcYH/w3 X-Received: by 2002:a25:4687:0:b0:dcd:30f7:f7d0 with SMTP id t129-20020a254687000000b00dcd30f7f7d0mr8050181yba.21.1709623785428; Mon, 04 Mar 2024 23:29:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709623785; cv=pass; d=google.com; s=arc-20160816; b=HAFTmKqoIkBkd8uGfHvF45gALEKoO9havA2L3/XfuOaZNuIs3l/AcAxNx290lE7MLS zYIJBpyOwevclefPRh5dHY1jCOStk3vQVa50vZExqtJg6KsLl6vDspjVxzZk1yQFjhAQ 3z+jVzBcr8J3Yc1bokBT95K5zeyhHH8E2/17EbKi2/ElukLfuiY3F/u4ayttensTpi9g M5bg2W46L3Tk0+bqaGlKs/EntmguweiFO+NpiZwB3ruqEzAnChmTe+KtpaAuIZcXm1lY Eldq9lpx77da9zgEVcktjFJhkeqv92SeojK+vnc7buktPtkncrlsJ8eG+dtn3xDMz2Jl eSnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=T4fNHU/mXNMJbX7RMGsb4i0CWwIrJWg17lL6zWXyK/k=; fh=YoyvrhSFX/gomruhs8E5v3LJBIcHojMCK8eMDUDpafQ=; b=mI1zCSZRdm7Dm+8KIyPhwJXb9s9by9TsVSKUIJHRtCkDGXqeD5nM28foYn42dHh0oz tRQ1PYvDyUdJC8GH217Y2SLCwZj4B+5ODWO5qApUUowd1vWmsL0sfSp6L1F/YdpmBhR4 ulgXJnFYbZr/8ZSsgDbp0CwfLZzZV2Af+q0Qa0S2I4BXDtKhu4NBzTFN8w3iQVGj5qGe /8EBrzGVsy+PpxI2+QGxwoV+WJZx4+zavZJJVeo0HyK/KM2muUZ8BZ6TtJbIngqHylZG 1w+XffXsJKgesBHfmzodqpmYz51OFBexbMGGpQw+LqUwc0RZGGAzqF5YEkfvLy1cMBDb m2GQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-91797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91797-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ay40-20020a05622a22a800b0042efaabc715si2254909qtb.202.2024.03.04.23.29.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 23:29:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-91797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91797-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2E6371C21FDD for ; Tue, 5 Mar 2024 07:29:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97D087E786; Tue, 5 Mar 2024 07:29:32 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D28017E11E; Tue, 5 Mar 2024 07:29:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709623772; cv=none; b=TR4sERAH/0IrKUWBF2GznOT6BBjoZBjcqWCqwTRDWFimC25plZMgHcLRJfv/CYckW2LWru8fkxjBeHCJHf4GKDzVHyIAXFDsfNVv3T7G/1JXYQHBQbojw9bQMRSypmO3kULk7oiM9I3Emsg3IsCfDDFjYuyZjT+xjHFCvhpw3gk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709623772; c=relaxed/simple; bh=LOAAo12TmpeMqfRlxKgrGSwC8uen4zm5weoQ2qlrzpg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q6fdH0+dn/rw3q6oSKC0ukbqwu5s4zXRvfVZ8EEFyG65l9+tHJ+sc+SUGUdeA/rf42O0cH8aO3gqlQUfOtNwVfbfUGFsneh3yjQmnnN01B4xlopHtCDNZmZwsmINyp/fwCCoLtrHXnlesaoa/KOaemERkIsxhDDxhcpunIBgS9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TpnJ26hfqz4f3k5b; Tue, 5 Mar 2024 15:29:22 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 6B2081A0C15; Tue, 5 Mar 2024 15:29:26 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgBHGBHRyeZlGnf+Fw--.17927S5; Tue, 05 Mar 2024 15:29:26 +0800 (CST) From: Yu Kuai To: xni@redhat.com, zkabelac@redhat.com, agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com, dm-devel@lists.linux.dev, song@kernel.org, yukuai3@huawei.com, heinzm@redhat.com, jbrassow@redhat.com, neilb@suse.de Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, yukuai1@huaweicloud.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: [PATCH md-6.8 v2 1/9] md: don't clear MD_RECOVERY_FROZEN for new dm-raid until resume Date: Tue, 5 Mar 2024 15:22:58 +0800 Message-Id: <20240305072306.2562024-2-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240305072306.2562024-1-yukuai1@huaweicloud.com> References: <20240305072306.2562024-1-yukuai1@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgBHGBHRyeZlGnf+Fw--.17927S5 X-Coremail-Antispam: 1UD129KBjvJXoW7Zw4ktrW3uryDCrW7CryxAFb_yoW8Gw47pa n7Gr1rurWkJrW2kF4DJa4v9a45tasxJrW0yryfu3y5Xr13Xr1kK34YgwnxZryqkF1aga45 AF1UAryrC3WrKw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBE14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kIc2 xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v2 6r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2 Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_ Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMI IF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JU4T5dUUUUU = X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ From: Yu Kuai After commit 9dbd1aa3a81c ("dm raid: add reshaping support to the target") raid_ctr() will set MD_RECOVERY_FROZEN before md_run() and expect to keep array frozen until resume. However, md_run() will clear the flag by setting mddev->recovery to 0. Before commit 1baae052cccd ("md: Don't ignore suspended array in md_check_recovery()"), dm-raid actually relied on suspending to prevent starting new sync_thread. Fix this problem by keeping 'MD_RECOVERY_FROZEN' for dm-raid in md_run(). Fixes: 1baae052cccd ("md: Don't ignore suspended array in md_check_recovery()") Fixes: 9dbd1aa3a81c ("dm raid: add reshaping support to the target") Signed-off-by: Yu Kuai Signed-off-by: Xiao Ni Acked-by: Mike Snitzer --- drivers/md/md.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 9e41a9aaba8b..23f31fd1d024 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6038,7 +6038,10 @@ int md_run(struct mddev *mddev) pr_warn("True protection against single-disk failure might be compromised.\n"); } - mddev->recovery = 0; + /* dm-raid expect sync_thread to be frozen until resume */ + if (mddev->gendisk) + mddev->recovery = 0; + /* may be over-ridden by personality */ mddev->resync_max_sectors = mddev->dev_sectors; -- 2.39.2