From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH hci-8.1 v7 00/10] dm-ploop: give back unused tail of top delta on suspend
Date: Tue, 17 Nov 2026 19:23:02 +0100 [thread overview]
Message-ID: <179493978229.173269.14776614188985558166.b4-review@b4> (raw)
In-Reply-To: <20261117171743.3216794-1-alexander.ivanov@virtuozzo.com>
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
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
prev parent reply other threads:[~2026-11-17 18:24 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 17:17 Alexander Ivanov
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 01/10] dm-ploop: reject a delta header whose BAT does not cover the target Alexander Ivanov
2026-11-17 17:22 ` no-reply
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 02/10] dm-ploop: reject empty deltas Alexander Ivanov
2026-11-17 17:22 ` no-reply
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 03/10] dm-ploop: set delta is_raw before applying its mappings Alexander Ivanov
2026-11-17 17:25 ` no-reply
2026-11-17 18:23 ` Konstantin Khorenko
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 04/10] dm-ploop: factor out ploop_read_delta() from ploop_add_delta() Alexander Ivanov
2026-11-17 17:24 ` no-reply
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 05/10] dm-ploop: take bat_lock around md page lookup in ploop_llseek_hole() Alexander Ivanov
2026-11-17 17:27 ` no-reply
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 06/10] dm-ploop: use wake_up() for inflight_md_wq Alexander Ivanov
2026-11-17 17:26 ` no-reply
2026-11-17 18:23 ` Konstantin Khorenko
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 07/10] dm-ploop: fix use-after-free on the last inflight_md decrement Alexander Ivanov
2026-11-17 17:32 ` no-reply
2026-11-17 18:23 ` Konstantin Khorenko
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 08/10] dm-ploop: fix flip_upper_deltas racing with resume Alexander Ivanov
2026-11-17 17:28 ` no-reply
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 09/10] dm-ploop: reload metadata on resume Alexander Ivanov
2026-11-17 17:36 ` no-reply
2026-11-17 18:23 ` Konstantin Khorenko
2026-11-17 17:17 ` [Devel] [PATCH hci-8.1 v7 10/10] dm-ploop: truncate unused tail of top delta on suspend Alexander Ivanov
2026-11-17 17:40 ` no-reply
2026-11-17 18:23 ` Konstantin Khorenko
2026-11-17 18:23 ` Konstantin Khorenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179493978229.173269.14776614188985558166.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=devel@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox