OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 0/3] dm-ploop: fix writes to a read-only device hanging the host
@ 2026-11-09 19:06 Denis V. Lunev
  2026-11-09 19:06 ` [Devel] [PATCH hci-8.1 1/3] dm-ploop: factor out ploop_dispatch_md_waiters() Denis V. Lunev
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Denis V. Lunev @ 2026-11-09 19:06 UTC (permalink / raw)
  To: khorenko, andrey.zhadchenko; +Cc: devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-09 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 19:06 [Devel] [PATCH hci-8.1 0/3] dm-ploop: fix writes to a read-only device hanging the host Denis V. Lunev
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox