public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: ein <ein.net@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Linux fs Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: RAID1 two chunks of the same data on the same physical disk, one file keeps being corrupted
Date: Thu, 16 Jan 2025 15:55:19 +0100	[thread overview]
Message-ID: <bd5809c4-b88a-4c41-95c4-b1ad89bbb0b5@gmail.com> (raw)
In-Reply-To: <3749cb72-a99f-4f4e-9682-e2cbf7604227@gmx.com>

On 13.01.2025 21:39, Qu Wenruo wrote:
> 在 2025/1/14 02:24, ein 写道:
>> On 29.07.2024 12:05, Qu Wenruo wrote:
>>> On 10.06.2024 16:56, ein wrote:
>>> In your case, I still do not believe it's hardware problem.
>>>
>>> > - it affects only one file, I have other much busier VMs, that one
>>> mostly stays idle,
>>>
>>> Due to btrfs' datacsum behavior, it's very sensitive to page content
>>> change during writeback.
>>>
>>> Normally this should not happen for buffered writes as btrfs has locked
>>> the page cache.
>>>
>>> But for Direct IO it's still very possible that one process submitted a
>>> direct IO, and when the IO was still under way, the user space changed
>>> the contents of that page.
>>>
>>> In that case, btrfs csum is calculated using that old contents, but the
>>> on-disk data is the new contents, causing the csum mismatch.
>>>
>>> So I'm wondering what's the workload inside the VM?
>>
>> As far as I know in such configuration there's no writeback:
>>
>> <disk type="file" device="disk">
>>    <driver name="qemu" type="qcow2" cache="none" discard="unmap"/>
>
> cache="none" means direct IO.
>
> Exactly the problem I mentioned, direct IO with data changed during
> writeback.
>
> You can change it to "cache=writeback" then it should resolve the false
> alert mismatch.
> (Or just simply change the disk image file to NODATASUM)
Hi Qu.
You were right, those errors still happened.
Switching to cache=writeback seemed to help for now.
Thank you.
>>    <source file="/var/lib/libvirt/images-red-btrfs/dell.qcow2" index="2"/>
>>    <backingStore/>
>>    <target dev="vda" bus="virtio"/>
>>    <alias name="virtio-disk0"/>
>>    <address type="pci" domain="0x0000" bus="0x00" slot="0x04"
>> function="0x0"/>
>> </disk>
>> [...]
>> <controller type="pci" index="0" model="pci-root">
>>    <alias name="pci.0"/>
>> </controller>
>>
>> This is mostly empty Win7 virtual machine with very small SQLite
>> database (100-500MiB) with some network monitoring tool.

      reply	other threads:[~2025-01-16 14:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 14:56 RAID1 two chunks of the same data on the same physical disk, one file keeps being corrupted ein
2024-07-29  8:43 ` ein
2024-07-29 10:05   ` Qu Wenruo
2025-01-13 15:54     ` ein
2025-01-13 20:39       ` Qu Wenruo
2025-01-16 14:55         ` ein [this message]

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=bd5809c4-b88a-4c41-95c4-b1ad89bbb0b5@gmail.com \
    --to=ein.net@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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