From nobody Tue Dec 2 01:07:59 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1F8632D8792; Mon, 24 Nov 2025 06:32:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763965930; cv=none; b=W1OlhE83hR6RnbJ+RlJoQFxs1g26ZNhcmsDnd1UtXiEh60AtWfHCzlNQtNP/JDSBXKBpO5dGfzc7c5OVIrOIb0qapYgyPxgBbSGJosj/+QOi0g1RXWo/wp5HBNdjvWuRHcY1fz4wL3ItFfnEFLzrY9ftxzi23TieAW4Yk4fzz2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763965930; c=relaxed/simple; bh=D0nbx1YulrTDvoWDzouAe7I7e0G5PEu7+nROD+Qkydc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sd8Mh3Qd/PwjIbJQCO2cNYVgr7Ovhmv2VUbC7B8iB9mh61wry9v3M6SmztJOaleVxSbSpN4xcdPFLAQxI5iq8YveeBttV1RM1tT+duIG5l0NuC/t5Urx9d0sqs/EEsETdKiSGzQsbU9hTQuj6d724Rrs/AygFKkXDZuTMm+tcYU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1588FC16AAE; Mon, 24 Nov 2025 06:32:07 +0000 (UTC) From: Yu Kuai To: song@kernel.org, linux-raid@vger.kernel.org Cc: linux-kernel@vger.kernel.org, filippo@debian.org, colyli@fnnas.com, yukuai@fnnas.com Subject: [PATCH v2 01/11] md: merge mddev has_superblock into mddev_flags Date: Mon, 24 Nov 2025 14:31:53 +0800 Message-ID: <20251124063203.1692144-2-yukuai@fnnas.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251124063203.1692144-1-yukuai@fnnas.com> References: <20251124063203.1692144-1-yukuai@fnnas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is not need to use a separate field in struct mddev, there are no functional changes. Signed-off-by: Yu Kuai --- drivers/md/md.c | 6 +++--- drivers/md/md.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 7b5c5967568f..b49fdee11a03 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6462,7 +6462,7 @@ int md_run(struct mddev *mddev) * the only valid external interface is through the md * device. */ - mddev->has_superblocks =3D false; + clear_bit(MD_HAS_SUPERBLOCK, &mddev->flags); rdev_for_each(rdev, mddev) { if (test_bit(Faulty, &rdev->flags)) continue; @@ -6475,7 +6475,7 @@ int md_run(struct mddev *mddev) } =20 if (rdev->sb_page) - mddev->has_superblocks =3D true; + set_bit(MD_HAS_SUPERBLOCK, &mddev->flags); =20 /* perform some consistency tests on the device. * We don't want the data to overlap the metadata, @@ -9085,7 +9085,7 @@ void md_write_start(struct mddev *mddev, struct bio *= bi) rcu_read_unlock(); if (did_change) sysfs_notify_dirent_safe(mddev->sysfs_state); - if (!mddev->has_superblocks) + if (!test_bit(MD_HAS_SUPERBLOCK, &mddev->flags)) return; wait_event(mddev->sb_wait, !test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags)); diff --git a/drivers/md/md.h b/drivers/md/md.h index 6985f2829bbd..b4c9aa600edd 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -340,6 +340,7 @@ struct md_cluster_operations; * array is ready yet. * @MD_BROKEN: This is used to stop writes and mark array as failed. * @MD_DELETED: This device is being deleted + * @MD_HAS_SUPERBLOCK: There is persistence sb in member disks. * * change UNSUPPORTED_MDDEV_FLAGS for each array type if new flag is added */ @@ -356,6 +357,7 @@ enum mddev_flags { MD_BROKEN, MD_DO_DELETE, MD_DELETED, + MD_HAS_SUPERBLOCK, }; =20 enum mddev_sb_flags { @@ -623,7 +625,6 @@ struct mddev { /* The sequence number for sync thread */ atomic_t sync_seq; =20 - bool has_superblocks:1; bool fail_last_dev:1; bool serialize_policy:1; }; --=20 2.51.0