On 2026/10/19 21:28, Mark Bundschuh wrote:
> If the device underlying a zoned target is removed, its capacity is set
> to 0 and blkdev_report_zones() returns 0 without reporting any zones.
> The mapped device keeps its old capacity, so args->zone_idx and
> args->next_sector never advance and dm_blk_do_report_zones() loops
> forever. On non-preemptible kernels this causes soft lockups and RCU
> stalls.
> 
> The following sequence of commands triggers the hang:
> 
> modprobe scsi_debug zbc=managed dev_size_mb=1024 zone_size_mb=64
> udevadm settle
> echo '0 2097152 linear /dev/sda 0' | dmsetup create lin
> echo 1 > /sys/block/sda/device/delete
> blkzone report -o 0 -c 1 /dev/mapper/lin
> 
> Fix this by returning -EIO when a target reports no zones. The target
> always maps args->next_sector, so a zero return means the underlying
> device no longer covers that sector.
> 
> Fixes: d41003513e61 ("block: rework zone reporting")
> Cc: [email protected]
> Signed-off-by: Mark Bundschuh <[email protected]>

Looks good.

Reviewed-by: Damien Le Moal <[email protected]>

-- 
Damien Le Moal
Western Digital Research

Reply via email to