[Devel] [PATCH hci-8.1 v6 04/12] dm-ploop: reject empty deltas

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Oct 13 14:24:17 MSK 2026


> 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>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261013111604.142989-1-alexander.ivanov@virtuozzo.com?part=4




More information about the Devel mailing list