linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Paulo Dias <paulo.miguel.dias@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: qcow2 images make scrub believe the filesystem is corrupted.
Date: Thu, 17 Aug 2017 19:39:17 -0400	[thread overview]
Message-ID: <20170817233916.GA25527@destiny> (raw)
In-Reply-To: <CADJPUQ9awnz30XzGZLGQAUhAqeH5ek6stDN5N5JTzc3dGtdiug@mail.gmail.com>

On Tue, Aug 15, 2017 at 10:12:28PM -0300, Paulo Dias wrote:
> Hello/2 all
> 
> I'm using libvirt with a qcow2 image and everytime i run btrfs scrub
> -H /home (subvolume where the image is), i get:
> 
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): bdev
> /dev/sda3 errs: wr 0, rd 0, flush 0, corrupt 30, gen 0
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): unable to
> fixup (regular) error at logical 289831161856 on dev /dev/sda3
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): bdev
> /dev/sda3 errs: wr 0, rd 0, flush 0, corrupt 31, gen 0
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): unable to
> fixup (regular) error at logical 289830309888 on dev /dev/sda3
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): bdev
> /dev/sda3 errs: wr 0, rd 0, flush 0, corrupt 32, gen 0
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): unable to
> fixup (regular) error at logical 289831055360 on dev /dev/sda3
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): bdev
> /dev/sda3 errs: wr 0, rd 0, flush 0, corrupt 33, gen 0
> ago 15 21:58:08 kerberos kernel: BTRFS error (device sda3): unable to
> fixup (regular) error at logical 289861591040 on dev /dev/sda3
> ago 15 21:58:09 kerberos kernel: BTRFS warning (device sda3): checksum
> error at logical 290297204736 on dev /dev/sda3, sector 67982824, root
> 258, inode 968837, offset 17455849472, length 4096, links 1 (path:
> groo/Fedora/Fedora.qcow2)
> ago 15 21:58:09 kerberos kernel: BTRFS error (device sda3): bdev
> /dev/sda3 errs: wr 0, rd 0, flush 0, corrupt 34, gen 0
> ago 15 21:58:09 kerberos kernel: BTRFS error (device sda3): unable to
> fixup (regular) error at logical 290297204736 on dev /dev/sda3
>

Tried replying from my phone, forgot the app defaults to HTML, trying again.

This is happening because the app (the guest OS in this case, we saw this a lot
with windows guests) is changing the pages while they are in flight.  We
calculate the checksum of the page before it's written, so if it changes while
in flight we'll end up with a csum mismatch.

To fix this change kvm to not use O_DIRECT or set NODATASUM on your qcow2 image.
You'll have to re-create the image because NODATASUM won't apply to the already
invalid checksums.  Thanks,

Josef 

  parent reply	other threads:[~2017-08-17 23:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16  1:12 qcow2 images make scrub believe the filesystem is corrupted Paulo Dias
2017-08-16  1:40 ` Qu Wenruo
2017-08-16  1:51   ` Paulo Dias
2017-08-16  2:28     ` Qu Wenruo
2017-08-16  2:46       ` Qu Wenruo
2017-08-16  7:47       ` Qu Wenruo
2017-08-16 23:32 ` Chris Murphy
2017-08-17  8:04   ` Duncan
2017-08-17 19:10     ` Chris Murphy
2017-08-17 20:17       ` Paulo Dias
2017-08-17 20:58         ` Chris Murphy
2017-08-17 23:39 ` Josef Bacik [this message]
2017-08-18 16:23   ` Goffredo Baroncelli
2017-08-18 17:43     ` Josef Bacik
2017-08-18 22:19       ` Goffredo Baroncelli
2017-08-19 13:08         ` Goffredo Baroncelli
2017-08-18 23:29       ` Qu Wenruo
2017-08-18 17:59     ` Liu Bo
2017-08-18 18:25       ` Paulo Dias

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=20170817233916.GA25527@destiny \
    --to=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=paulo.miguel.dias@gmail.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;
as well as URLs for NNTP newsgroup(s).