[Devel] [PATCH hci-8.1 3/3] dm-ploop: fail writes to a read-only device
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Nov 10 20:11:13 MSK 2026
Applying with these fixes on my side:
- "punches or zeroes it with vfs_fallocate(), which does, and fails
with EBADF" -> "punches or zeroes it with vfs_fallocate() inside the
file and preallocates space past its end. Both check FMODE_WRITE and
fail";
- "Kill write requests" -> "Kill write and discard requests";
- added a paragraph on what users see now: a read-write mount of a
partition over a read-only ploop device, and a read-only ext4 mount
that has to replay its journal through it, fail with an I/O error
instead of changing the image.
On Mon, 9 Nov 2026 20:06:04 +0100, Denis V. Lunev wrote:
> does not check FMODE_WRITE, so it reaches the image. Allocating a cluster
> punches or zeroes it with vfs_fallocate(), which does, and fails with
> EBADF, so part of such a write fails with an I/O error and the rest
A cluster past the end of the file goes to the preallocation, where
do_ftruncate() on the read-only file fails with EINVAL and the write
gets EIO after the retries, not EBADF.
> Kill write requests of a read-only table in ploop_clone_and_map(), as
op_is_write() matches discards too, and both mounts above used to work
by writing into the image. Whoever hits such a failed mount now should
find the reason in this message.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
More information about the Devel
mailing list