]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerYu Kuai <yukuai3@huawei.com>
Fri, 30 May 2025 07:47:23 +0000 (15:47 +0800)
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>
drivers/md/md-bitmap.c

index 37b08f26c62f5d97b256733ee06b59a055318fe1..45dd3d9f01a8e188938e66e44d752da2c6efc692 100644 (file)
@@ -789,7 +789,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;