OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 0/2] dm-zero-rq: fix a crash on a flush after ploop release
Date: Wed, 28 Oct 2026 13:31:27 +0100	[thread overview]
Message-ID: <20261028123130.2828357-1-den@openvz.org> (raw)

ploop releases a device by reloading it to the error target, and
ploop_dmreload_zero() (VSTOR-146886) later reloads it to zero-rq while
the file system on top is still mounted. A request queued against the previous table waits out
the suspend and is dispatched to zero-rq on resume.

For a flush this is a host panic: the flush request has no bio and
zero_clone_and_map_rq() reads the operation from rq->bio. QA hit it in
the vzctl release-disks test on hci-8.1 (VSTOR-152097): sgdisk run by
"vzctl release-disks" called sync() just before the reload. The vmcore
shows the queue's own flush_rq (REQ_OP_FLUSH, bio NULL, end_io
flush_end_io) in zero-rq, and the original empty PREFLUSH bio from
ext4_sync_fs() still waiting on the flush queue.

Patch 1 fixes the crash: the operation is taken from the request, and a
flush is killed like any other request zero-rq does not handle. Patch 2
completes flushes, discards and write zeroes instead of failing them,
which is what the zero-rq reload is there for. It is split out because
it changes what the target returns, not only whether it crashes.

The error and multipath request-based targets do not look at rq->bio,
so mainline is not affected; dm-zero-rq is ours.

Tested on 6.12.0-211.52.1.22.10.vz10 with the module built out of tree,
by suspending a released device, starting a sync or a blkdiscard on it,
then running ploop_dmreload_zero():
- stock: the node panics with the oops QA got, every time;
- patch 1: no panic, the sync and the discard fail with EIO;
- patches 1+2: both complete, nothing in the log;
- the ploop release tests, ploop and qcow2 formats, pass. The new
  tests for ploop_dmreload_zero() and the reproducer above go to ploop
  separately.

Denis V. Lunev (2):
  dm-zero-rq: fix a NULL dereference mapping a flush request
  dm-zero-rq: drop flushes, discards and write zeroes instead of failing
    them

 drivers/md/dm-zero-rq.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)


base-commit: b499efa17aa9fb8f20512d1831d1cb61b22e60d3
-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

             reply	other threads:[~2026-10-28 12:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 12:31 Denis V. Lunev [this message]
2026-10-28 12:31 ` [Devel] [PATCH hci-8.1 1/2] dm-zero-rq: fix a NULL dereference mapping a flush request Denis V. Lunev
2026-10-28 12:34   ` no-reply
2026-10-28 12:31 ` [Devel] [PATCH hci-8.1 2/2] dm-zero-rq: drop flushes, discards and write zeroes instead of failing them Denis V. Lunev
2026-10-28 12:34   ` no-reply
2026-10-29 17:40   ` Konstantin Khorenko
2026-10-28 12:44 ` [Devel] [PATCH hci-8.1 0/2] dm-zero-rq: fix a crash on a flush after ploop release Andrey Zhadchenko
2026-10-29 17:40 ` Konstantin Khorenko
2026-10-29 17:44 ` Konstantin Khorenko

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=20261028123130.2828357-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.zhadchenko@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