[PATCH 13/23] md/md-bitmap: fix dm-raid max_write_behind setting

Yu Kuai posted 23 patches 6 months, 4 weeks ago
There is a newer version of this series
[PATCH 13/23] md/md-bitmap: fix dm-raid max_write_behind setting
Posted by Yu Kuai 6 months, 4 weeks ago
From: Yu Kuai <yukuai3@huawei.com>

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

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/md/md-bitmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 689d5dba9328..535bc1888e8c 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -777,7 +777,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;
-- 
2.39.2
Re: [PATCH 13/23] md/md-bitmap: fix dm-raid max_write_behind setting
Posted by Hannes Reinecke 6 months, 3 weeks ago
On 5/24/25 08:13, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> It's supposed to be COUNTER_MAX / 2, not COUNTER_MAX.
> 
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>   drivers/md/md-bitmap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
> index 689d5dba9328..535bc1888e8c 100644
> --- a/drivers/md/md-bitmap.c
> +++ b/drivers/md/md-bitmap.c
> @@ -777,7 +777,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;

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Re: [PATCH 13/23] md/md-bitmap: fix dm-raid max_write_behind setting
Posted by Christoph Hellwig 6 months, 3 weeks ago
On Sat, May 24, 2025 at 02:13:10PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
> 
> It's supposed to be COUNTER_MAX / 2, not COUNTER_MAX.

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

And maybe move this to the front of the series and/or submit it ASAP
for 6.16?