Commit f0bd038
md: init queue_limits->max_hw_wzeroes_unmap_sectors parameter
The parameter max_hw_wzeroes_unmap_sectors in queue_limits should be
equal to max_write_zeroes_sectors if it is set to a non-zero value.
However, the stacked md drivers call md_init_stacking_limits() to
initialize this parameter to UINT_MAX but only adjust
max_write_zeroes_sectors when setting limits. Therefore, this
discrepancy triggers a value check failure in blk_validate_limits().
$ modprobe scsi_debug num_parts=2 dev_size_mb=8 lbprz=1 lbpws=1
$ mdadm --create /dev/md0 --level=0 --raid-device=2 /dev/sda1 /dev/sda2
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Invalid argument
Fix this failure by explicitly setting max_hw_wzeroes_unmap_sectors to
max_write_zeroes_sectors. Since the linear and raid0 drivers support
write zeroes, so they can support unmap write zeroes operation if all of
the backend devices support it. However, the raid1/10/5 drivers don't
support write zeroes, so we have to set it to zero.
Fixes: 0c40d7c ("block: introduce max_{hw|user}_wzeroes_unmap_sectors to queue limits")
Reported-by: John Garry <[email protected]>
Closes: https://lore.kernel.org/linux-block/[email protected]/
Signed-off-by: Zhang Yi <[email protected]>
Tested-by: John Garry <[email protected]>
Reviewed-by: Li Nan <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Reviewed-by: Yu Kuai <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Link: https://lore.kernel.org/linux-raid/[email protected]
Signed-off-by: Yu Kuai <[email protected]>1 parent 743bf03 commit f0bd038
5 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3211 | 3211 | | |
3212 | 3212 | | |
3213 | 3213 | | |
| 3214 | + | |
3214 | 3215 | | |
3215 | 3216 | | |
3216 | 3217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4008 | 4008 | | |
4009 | 4009 | | |
4010 | 4010 | | |
| 4011 | + | |
4011 | 4012 | | |
4012 | 4013 | | |
4013 | 4014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7732 | 7732 | | |
7733 | 7733 | | |
7734 | 7734 | | |
| 7735 | + | |
7735 | 7736 | | |
7736 | 7737 | | |
7737 | 7738 | | |
| |||
0 commit comments