OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: khorenko@virtuozzo.com, andrey.zhadchenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 0/3] dm-ploop: fix writes to a read-only device hanging the host
Date: Mon,  9 Nov 2026 20:06:01 +0100	[thread overview]
Message-ID: <20261109190604.1850504-1-den@openvz.org> (raw)

A write that reaches a read-only ploop device never completes: the
writer hangs in D state, and after a buffered write every later sync on
the host hangs behind it until a reboot. Such writes come from a device
stacked on top. libploop leaves the partition of "ploop mount -r"
writable, which the ploop side fixes in openvz/ploop.ovz PR 513, and
libvzctl attaches a backup disk to a Container that way and mounts it
read-write (VSTOR-154096).

Two bugs meet there:
- when a cluster allocation or a discard fails, the pios parked on that
  BAT page are never resubmitted (patch 2). Any failing allocation
  leaves them stuck, not only one on a read-only device. Patch 1 moves
  the resubmission loop into a helper for it;
- dm-ploop does not refuse writes to a read-only table, as dm-qcow2
  does since 409d7e697578 (patch 3). The data of such a write reaches
  the image through f_op->write_iter(), while the allocation of a new
  cluster fails with EBADF and lands in the bug of patch 2.

Tested on 6.12.0-211.52.1.22.19.vz10, dm-ploop built out of tree:
- read-only ploop image, its partition mounted read-write, dd of 16M
  with conv=fsync. Stock: the writer and sync stuck in D state until a
  reboot, 12 writes in flight, the image changed. Patches 1-2: the
  fsync fails with EIO, nothing hangs, the image still changes. The
  whole series: the mount fails on its first superblock write, nothing
  hangs, the image is unchanged;
- ploop test suite, make -j48 test on dev-cl04, green for ploop and
  qcow2 with this series together with the VSTOR-154182 one. Its new
  test overwrites a block through a linear device stacked on a
  read-only device: it fails on stock and passes with both series.

Denis V. Lunev (3):
  dm-ploop: factor out ploop_dispatch_md_waiters()
  dm-ploop: fix pios stuck in md->wait_llist after a failed BAT update
  dm-ploop: fail writes to a read-only device

 drivers/md/dm-ploop-map.c | 41 ++++++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 13 deletions(-)

-- 
2.53.0

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

             reply	other threads:[~2026-11-09 19:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 19:06 Denis V. Lunev [this message]
2026-11-09 19:06 ` [Devel] [PATCH hci-8.1 1/3] dm-ploop: factor out ploop_dispatch_md_waiters() Denis V. Lunev
2026-11-09 19:15   ` no-reply
2026-11-09 19:06 ` [Devel] [PATCH hci-8.1 2/3] dm-ploop: fix pios stuck in md->wait_llist after a failed BAT update Denis V. Lunev
2026-11-09 19:18   ` no-reply
2026-11-09 19:06 ` [Devel] [PATCH hci-8.1 3/3] dm-ploop: fail writes to a read-only device Denis V. Lunev
2026-11-09 19:19   ` no-reply

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=20261109190604.1850504-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.zhadchenko@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    /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