linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave T <davestechshop@gmail.com>
To: Qu Wenruo <wqu@suse.com>
Cc: Qu Wenruo <quwenruo.btrfs@gmx.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: bad file extent, some csum missing - how to check that restored volumes are error-free?
Date: Thu, 15 Jul 2021 18:49:39 -0400	[thread overview]
Message-ID: <CAGdWbB6CrFc319fwRwmkd=zrVE4jabF0GTpqZd5Jjzx2RcAo9Q@mail.gmail.com> (raw)
In-Reply-To: <520a696d-d747-ef86-4560-0ec25897e0e1@suse.com>

> OK, lowmem mode indeed did a much better job.
>
> This is a very strange bug.
>
> This means:
>
> - The compressed extent doesn't have csum
>    Which shouldn't be possible for recent kernels.
>
> - The compressed extent exists for inode which has NODATASUM flag
>    Not possible again for recent kernels.
>
> But IIRC there are old kernels allowing such compression + nodatasum.
>
> I guess that's the reason why you got EIO when reading it.
>
> When we failed to find csum, we just put 0x00 as csum, and then when you
> read the data, it's definitely going to cause csum mismatch and nothing
> get read out.
>
> This can be worked around by recent "rescue=idatacsums" mount option.
>
> But to me, this really looks like some old fs, with some inodes created
> by older kernels.

I'm running:
kernel version 5.12.15-arch1-1 (linux@archlinux)

I've been running arch + btrfs since 2014. I keep arch linux fully
updated. I'm running new kernels and new btrfs progs. However, I
created this filesystem around 2014.

Is there an option to "update" my BTRFS filesystem? Is that even a thing?

I have multiple devices running on BTRFS filesystems created around
2014 to 2016. Are those all in danger of having some problems now?
BTRFS has been mostly problem-free for me since before 2014. I do
regular balance and scrubs. However, I'm getting worried about my data
now...

I hope I do not need to backup every device, recreate the filesystems,
and restore them. That would be weeks of work and I'm already
overworked... but losing data would be worse.

BTW, even my backup disks run on BTRFS filesystems that were created years ago.

> > Are any of these options appropriate?
> >
> > -  btrfs rescue chunk-recover /dev/mapper/xyz
>
> Definite no.
>
> Any rescue command should only be used when some developer suggested.

Thank you for reminding me! There's a lot of bad BTRFS advice on all
the various forums, and it is easy to be influenced by it when you are
a casual user like me.


> > - btrfs check --repair --init-csum-tree /dev/mapper/xyz
>
> This may solve the read error, but we will still report the NODATACSUM
> problem for the compressed extent.
>
> Have you tried to remove the NODATASUM option for those involved inodes?

https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs(5)
says:
Note: If compression is enabled, nodatacow and nodatasum are disabled.

My mount options are:
rw,autodefrag,noatime,nodiratime,compress=lzo,space_cache,subvol=xyz

Do I understand it correctly? My compression option should already
"remove the NODATASUM".

>
> If it's possible to remove NODATASUM for those inodes, then
> --init-csum-tree should be able to solve the problem.

What do you recommend now?

  reply	other threads:[~2021-07-15 22:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 17:53 bad file extent, some csum missing - how to check that restored volumes are error-free? Dave T
2021-07-14 22:51 ` Qu Wenruo
     [not found]   ` <CAGdWbB44nH7dgdP3qO_bFYZwbkrW37OwFEVTE2Bn+rn4d7zWiQ@mail.gmail.com>
     [not found]     ` <43e7dc04-c862-fff1-45af-fd779206d71c@gmx.com>
     [not found]       ` <CAGdWbB7Q98tSbPgHUBF+yjqYRBPZ-a42hd=xLwMZUMO46gfd0A@mail.gmail.com>
2021-07-15 22:19         ` Dave T
2021-07-15 22:30           ` Qu Wenruo
2021-07-15 22:49             ` Dave T [this message]
2021-07-16  1:05               ` Qu Wenruo
2021-07-16  2:32                 ` Qu Wenruo
2021-07-16 13:15                 ` Dave T
2021-07-16 13:28                   ` Qu Wenruo
2021-07-16 15:40                     ` Dave T
2021-07-16 23:06                       ` Qu Wenruo
2021-07-17  0:18                         ` Dave T
2021-07-17  0:25                           ` Qu Wenruo
2021-07-17  0:57                             ` Dave T
2021-07-17  0:59                               ` Qu Wenruo
2021-07-25 17:34                                 ` Dave T
2021-07-25 23:51                                   ` Qu Wenruo

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='CAGdWbB6CrFc319fwRwmkd=zrVE4jabF0GTpqZd5Jjzx2RcAo9Q@mail.gmail.com' \
    --to=davestechshop@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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).