[Devel] [PATCH hci-8.1 v2 3/3] dm-qcow2: fix SEEK_HOLE/SEEK_DATA using an image freed by a merge
Konstantin Khorenko
khorenko at virtuozzo.com
Wed Nov 4 19:59:49 MSK 2026
I won't apply this version, please send v2 with the changes below.
On 11/3/26 10:08, Denis V. Lunev wrote:
> + down_write(&tgt->seek_rwsem);
> qcow2 = *tgt->backward_merge.pqcow2;
> *tgt->backward_merge.pqcow2 = qcow2->lower;
Item 4 of the cover letter reply: say in the message that merge_backward
complete now waits for a running seek while it holds ctl_mutex. Guest
I/O is no longer held, but every target message and presuspend queue
behind ctl_mutex for as long as the scan runs. That is a fair price,
the message just has to say it.
> + down_read(&tgt->seek_rwsem);
> + qcow2 = tgt->top;
Item 7 of the cover letter reply, a separate patch: when an md page read
of a seek fails, the waiting seek qio is ended, but nothing completes
SEEK_QIO_DATA(qio)->compl, so the seek sleeps forever. That is older
than this patch, but now the seek sleeps holding seek_rwsem, so the next
merge_backward complete and every message after it hang under ctl_mutex
too.
With the message fixed:
Reviewed-by: Konstantin Khorenko <khorenko at virtuozzo.com>
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list