]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
md/md-bitmap: fix dm-raid max_write_behind setting
authorYu Kuai <yukuai3@huawei.com>
Sat, 24 May 2025 06:13:10 +0000 (14:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 08:57:55 +0000 (10:57 +0200)
[ Upstream commit 2afe17794cfed5f80295b1b9facd66e6f65e5002 ]

It's supposed to be COUNTER_MAX / 2, not COUNTER_MAX.

Link: https://lore.kernel.org/linux-raid/20250524061320.370630-14-yukuai1@huaweicloud.com
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/md-bitmap.c

index 02629516748e40d5e3e7a752d9f136bab89b8f2b..dac27206cd3df73ff21dd831548bc94a2e0d5d96 100644 (file)
@@ -546,7 +546,7 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap)
         * is a good choice?  We choose COUNTER_MAX / 2 arbitrarily.
         */
        write_behind = bitmap->mddev->bitmap_info.max_write_behind;
-       if (write_behind > COUNTER_MAX)
+       if (write_behind > COUNTER_MAX / 2)
                write_behind = COUNTER_MAX / 2;
        sb->write_behind = cpu_to_le32(write_behind);
        bitmap->mddev->bitmap_info.max_write_behind = write_behind;