[Devel] [PATCH hci-8.1 v7 02/10] dm-ploop: reject empty deltas
no-reply at sashiko.virtuozzo.com
no-reply at sashiko.virtuozzo.com
Tue Nov 17 20:22:49 MSK 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dm-ploop: bug-fix commit lacks a Fixes: trailer for the driver
import
--
commit b52a2d20671de0cbbaeaf4282116b164f5fc9dc9
Author: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
dm-ploop: reject empty deltas
This commit rejects deltas with zero BAT entries. It adds a !delta_nr_be check in ploop_delta_check_header() and a zero-size check for raw deltas in ploop_add_delta().
> dm-ploop: reject empty deltas
>
> ploop_delta_check_header() accepts a header with m_Size == 0, and
> ploop_add_delta() accepts a raw delta of zero size. The BAT iterators
> can't handle nr_be == 0: ploop_bat_clu_to_page_nr(nr_be - 1) wraps to
> page 0, so md pages past the first one are iterated whole and the
> clu == nr_be - 1 stop condition never matches. A non-raw empty delta
> has a single md page, so ploop_apply_delta_mappings() and
> notify_delta_merged() (and ploop_check_delta_before_flip() with
> PLOOP_DEBUG) walk past it and dereference a NULL d_md on a device with
> more than one md page. A raw delta is not handled as raw yet, as
> ploop_add_delta() sets is_raw only after applying its mappings; once it
> is, an empty raw delta would get all the clusters mapped to it.
>
> Reject empty deltas in ploop_delta_check_header(), which covers every
> caller reading a delta header, and in ploop_add_delta() for raw deltas.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-148171
> Feature: dm-ploop: ploop target driver
>
> Signed-off-by: Alexander Ivanov <alexander.ivanov at virtuozzo.com>
[Severity: Low]
This fixes a real validation gap that has been there since the driver was
added. Should it carry a Fixes: tag, so that backport tooling can track
it?
Fixes: 90bb85536272 ("dm-ploop: Add ploop target driver")
--
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261117171743.3216794-1-alexander.ivanov@virtuozzo.com?part=2
More information about the Devel
mailing list