Re: [PATCH] zloop: reject mismatched conventional zone files on restore

From: Damien Le Moal

Date: Tue Nov 03 2026 - 00:09:59 EST


On 10/31/26 23:16, shao.mingyin@xxxxxxxxxx wrote:
> From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
>
> When restoring a zloop device, zloop_init_zone() checks that the size of
> each conventional zone file matches the configured zone size. The check
> prints an error and then jumps to out_fput, which releases the zone file
> and returns the value left in "ret" by the preceding vfs_getattr() call,
> that is, zero. zloop_ctl_add() therefore treats the zone as initialized
> and continues with a zone->file pointer that was already released; any
> I/O to that zone then dereferences it.
>
> Return -EINVAL, like the sequential zone path does for the same kind of
> inconsistency.
>
> While at it, print the zone size that is actually compared instead of the
> zone capacity, which may be smaller and only made the message confusing.
>
> Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
> Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>

Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>

--
Damien Le Moal
Western Digital Research