From: Roland <devzero@web.de>
To: Hannes Reinecke <hare@suse.de>,
Reindl Harald <h.reindl@thelounge.net>,
linux-raid@vger.kernel.org
Subject: Re: status of bugzilla #99171 - mdraid broken for O_DIRECT
Date: Sat, 11 Oct 2025 21:25:27 +0200 [thread overview]
Message-ID: <4f333665-9e4f-499c-9cda-fe87d221933a@web.de> (raw)
In-Reply-To: <d5227acf-73ff-4cfe-a699-061b75b2d0d3@suse.de>
hello,
some late reply for this...
> Am 10.10.24 um 10:34 schrieb Hannes Reinecke:
> Which I really would love
> to see reproduced, especially with recent kernels, as there is a lot of
> vagueness around it (add part of the disk on the raid as swap? How?
> In the host? On the guest?).
here is a reproducer everybody should be able to follow/reproduce.
1. install proxmox pve9 on a system with two empty disks for mdraid.
build mdraid and format with ext4 .
2. add that ext4 mountpoint as a datastore type "dir" for file/vm
storage in proxmox.
3. install a debian13 in a normal/default (cache=none, i.e. O_DIRECT =
on) linux VM. the virtual disk should be backed by that mdraid/ext4
datastore created above.
4. inside the vm as an ordinary user get break-raid-odirect.c from
https://forum.proxmox.com/threads/mdraid-o_direct.156036/post-713543 ,
compile that and let that run for a while. then terminate with ctrl-c.
5. on the pve host, check if your raid did not throw any error or has
mismatch_count >0 ( cat /sys/block/md127/md/mismatch_cnt ) in the meantime.
6. on the pve host start raid check with "echo check >
/sys/block/md127/md/sync_action"
6. let that check run and wait until it finishes (/proc/mdstat)
7. check for inconsistencies via "cat /sys/block/md127/md/mismatch_cnt"
again
i am getting:
cat /sys/block/md127/md/mismatch_cnt
1048832
so , we see that even with recent kernel (pve9 kernel is 6.14 based on
ubuntu kernel), we can break mdraid from non-root user inside a qemu VM
on top ext4 on top of mdraid.
roland
Am 10.10.24 um 10:34 schrieb Hannes Reinecke:
> On 10/10/24 09:29, Roland wrote:
>> thank you for clearing things up.
>>
>> >Which means that the test case is actually invalid; you either would
>> need drop O_DIRECT or modify the buffer
>> >after write() to arrive with a valid example.
>>
>> ok, but what about running virtual machines in O_DIRECT mode on top of
>> mdraid then ?
>>
>> https://forum.proxmox.com/threads/zfs-on-debian-or-mdadm-softraid-
>> stability-and-reliability-of-zfs.116871/post-505697
>>
>
> The example quoted is this:
> > Take a virtual machine, give it a disk - put the image on a software
> > raid and tell qemu to disable caching (iow. use O_DIRECT, because the
> > guest already does caching anyway).
> > Run linux in the VM, add part of the/a disk on the raid as swap, and
> > cause the guest to start swapping a lot.
>
> And then ending up with data corruption on MD. Which I really would love
> to see reproduced, especially with recent kernels, as there is a lot of
> vagueness around it (add part of the disk on the raid as swap? How?
> In the host? On the guest?).
>
> Hint: we (SUSE) have a bugzilla.suse.com. And if someone would be
> reproducing that with, say, OpenSUSE Tumbleweed and open a bugzilla
> someone on this list would be more than happy to have a look and do
> a proper debugging here. There are a lot of things which have changed
> since 2017 (Stable pages? Anyone?), so it might be that the cited issue
> simply is not reproducible anymore.
>
> Cheers,
>
> Hannes
next prev parent reply other threads:[~2025-10-11 19:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 20:08 status of bugzilla #99171 - mdraid broken for O_DIRECT Roland
2024-10-09 21:38 ` Reindl Harald
2024-10-10 6:53 ` Hannes Reinecke
2024-10-10 7:29 ` Roland
2024-10-10 8:34 ` Hannes Reinecke
2025-10-11 19:25 ` Roland [this message]
2025-10-13 6:48 ` Hannes Reinecke
2025-10-13 19:06 ` Roland
[not found] ` <6fb3e2cb-8eeb-4e76-9364-16348d807784@web.de>
2025-10-14 6:31 ` Hannes Reinecke
[not found] <A4168F21-4CDF-4BAD-8754-30BAA1315C6F@web.de>
2025-10-14 20:14 ` Roland
2025-10-15 6:56 ` Hannes Reinecke
2025-10-15 23:09 ` Roland
2025-10-16 6:02 ` Hannes Reinecke
2025-10-17 20:18 ` Roland
2025-10-20 6:44 ` Hannes Reinecke
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=4f333665-9e4f-499c-9cda-fe87d221933a@web.de \
--to=devzero@web.de \
--cc=h.reindl@thelounge.net \
--cc=hare@suse.de \
--cc=linux-raid@vger.kernel.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