[Devel] [PATCH hci-8.2 v10 8/9] dm-ploop: reload metadata on resume
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Nov 19 18:50:27 MSK 2026
I won't apply this version, please send v11, items 1 and 2 of the
cover letter reply.
On Thu, 19 Nov 2026 16:15:46 +0100, Alexander Ivanov wrote:
> +void ploop_drop_prealloc(struct ploop *ploop)
> +{
> + unsigned long flags;
> +
> + spin_lock_irqsave(&ploop->bat_lock, flags);
> + ploop->prealloc_size = 0;
> + spin_unlock_irqrestore(&ploop->bat_lock, flags);
> +}
ploop_req_prealloc() wakes only the allocator thread, and
ploop_allocator() calls wake_up() only after it took a non-zero
prealloc_size. A drop between the request and the allocator's look
leaves the waiter of that request asleep with its condition already
true. The first ploop_stop_prealloc() in postsuspend runs before
ctl_rwsem, so a resize of the live device can be that waiter, and
postsuspend then blocks on ctl_rwsem with md->suspend_lock held.
> a message may slip in before the lock, and would make the reload skip
> silently. Keep metadata that is still dirty on resume, as md pages may
v10 warns on that skip now.
> ->suspended, and wait again: a message that took the lock first saw the
> device not suspended and left its requests. Messages to the suspended
Five sentences in this paragraph; start a new one at "Drop them once
more". "Both wait" below reads as the two kinds of requests, name
postsuspend and messages.
Your answer to Sashiko on v9, that standby is set only on completion
of DM data and flush bios, does not hold: resize and merge pios and
BAT writeback complete through ploop_data_rw_complete() too, which
calls ploop_check_standby_mode(). The wait is no worse than before
the series, so no change is asked, just do not put that claim in a
message.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list