[Devel] [PATCH hci-8.1 v7 00/10] dm-ploop: give back unused tail of top delta on suspend

Konstantin Khorenko khorenko at virtuozzo.com
Tue Nov 17 21:23:02 MSK 2026


I won't apply this version, please send v8 with the changes below.

1. Cover letter: it is the b4 placeholder. Say why the series is
   needed, which patches are fixes and which build the feature, the
   userspace part it depends on and the deploy order, and what
   changed since v6.
2. 9/10: a killed or skipped wait for preallocation in postsuspend
   lets the old allocator shrink the top delta under the next table.
   Make the allocator unable to shrink the file, or keep the wait
   uninterruptible outside standby; name a5836033b8fe9 in the
   message.
3. 9/10: wait for inflight_md in ploop_preresume() too: a resize on
   the suspended device can leave it non-zero, and the WARN_ON_ONCE()
   in ploop_reload_metadata() fires.
4. 9/10, 10/10: the comment "Here must be the only place to change
   file_size" in ploop_preallocate_cluster() is not true any more.
5. 7/10: the comment of ploop_dec_inflight_md() says waiters take the
   lock before acting on zero; the postsuspend wait of 9/10 does not.
   Say that ploop_destroy() takes the lock, which is what keeps it
   safe.
6. 6/10: fold it into 7/10, which replaces both lines it changes.
7. 10/10 message: the file size check is best effort, and removal of
   a live device runs the suspend hooks from __dm_destroy() only
   because an open device cannot be removed; say both.
8. Fixes: 90bb85536272 ("dm-ploop: Add ploop target driver") on 1/10,
   2/10, 3/10 and 8/10; Fixes: d1a1e5108aeb ("dm-ploop: add inflight
   metadata writeback counter") on 7/10. In 3/10 cite 90bb85536272
   too: 6ddad5a4d226 is not in this branch.

Separate patches, not needed for this series. I created a task:

1. ploop_add_delta() stores the file in deltas[level].file before it
   clones it; if kcalloc() or file_clone_open() fails, the file is
   put twice, at err_fput and in ploop_destroy().
   https://virtuozzo.atlassian.net/browse/VSTOR-155723

On Tue, 17 Nov 2026 18:17:34 +0100, Alexander Ivanov wrote:
> *** BLURB HERE ***

2. The table reload case: the suspending process is killed while
postsuspend waits for the allocator of the old table. The new table
reloads metadata and preallocates. The old allocator then calls
do_ftruncate() with the new_len it computed from its stale file_size,
and ploop_truncate_prealloc_safe() compares new_len only with that
stale size, so the file shrinks and the clusters the new table has
written are cut. The next load fails with -EPROTO. a5836033b8fe9 made
this wait uninterruptible for that reason.

3. ploop_put_piwb() calls complete() before ploop_dec_inflight_md().
A "resize" message on the suspended device returns as soon as it is
woken; a resume right after it sees inflight_md == 1, the WARN fires,
which panics hosts with panic_on_warn, and the reload is skipped.

Thanks.

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team



More information about the Devel mailing list