[PATCH 1/2] md: init queue_limits->max_hw_wzeroes_unmap_sectors parameter

Yu Kuai yukuai1 at huaweicloud.com
Wed Sep 10 10:31:47 CEST 2025


Hi,

在 2025/09/02 20:25, John Garry 写道:
>> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
>> index 408c26398321..35c6498b4917 100644
>> --- a/drivers/md/raid1.c
>> +++ b/drivers/md/raid1.c
>> @@ -3211,6 +3211,7 @@ static int raid1_set_limits(struct mddev *mddev)
>>       md_init_stacking_limits(&lim);
>>       lim.max_write_zeroes_sectors = 0;
>> +    lim.max_hw_wzeroes_unmap_sectors = 0;
> 
> It would be better if we documented why we cannot support this on 
> raid1/10, yet we can on raid0.
> 
> I am looking through the history of why max_write_zeroes_sectors is set 
> to zero. I have gone as far back as 5026d7a9b, and this tells us that 
> the retry mechanism for WRITE SAME causes an issue where mirrors are 
> offlined (and so we disabled the support); and this was simply copied 
> for write zeroes in 3deff1a70.

Yes, we don't support it for now, and I think it is not too hard to
support write zeros, and finaly to support unmap zeros. BTW, raid5
discard is in the same suituation.

However, I feel this is not related to this set, perhaps a seperate
patch to add comments, I can accept that.

Thanks,
Kuai



More information about the drbd-dev mailing list