On 2019/10/19 上午1:18, ‍小太 wrote:
> Hi, I recently got the following error in dmesg while taking an
> incremental backup of my data:
> 
> [26876.491167] BTRFS critical (device dm-0): corrupt leaf: root=258
> block=739531833344 slot=0 ino=19366566, invalid mode: has 00 expect
> valid S_IF* bit(s)

Tree-checker detects an invalid inode mode bit.

From previous report, it should be caused by older kernel around 2014.

> [26876.491171] BTRFS error (device dm-0): block=739531833344 read time
> tree block corruption detected
> 
> It is triggered whenever stat() is called on one of these files:
> $ ls -lR >/dev/null
> ls: cannot access './<redacted a>/2018-05-31.220504+1000AEST.html':
> Input/output error
> ls: cannot access './<redacted b>/2018-05-31.200836+1000AEST.html':
> Input/output error
> ls: cannot access './<redacted c>/2018-05-31.201834+1000AEST.html':
> Input/output error
> ls: cannot access './<redacted d>/2018-05-31.222947+1000AEST.html':
> Input/output error
> 
> https://btrfs.wiki.kernel.org/index.php/Tree-checker#How_to_handle_such_error
> tells me to post on this mailing list upon getting such an error, so
> here I am.
> 
> What's happened?

Your 2014 kernel created some bad inodes.

> How can I fix this?

There are two solutions:
- Remove the offending inodes using older kernel
  The problem is, you need to find *all* offending inodes.
  Tree-checker can only report the first one it hits, can't
  report all.
  The offending inodes is reported by the "ino=%llu" part of the kernel
  message.

- Use out-of-tree btrfs-check.
  The report and repair functionality hasn't been merged yet, but you
  can still try them using this branch:
  https://github.com/adam900710/btrfs-progs/tree/for_next

  You can fix it using "./btrfs check --repair" but you need to compile
  the branch.

Thanks,
Qu

> Should I just restore from backup?
> 
> Various diagnostic command outputs:
> 
> $ uname -a
> Linux home.kota.moe 5.2.0-3-rt-amd64 #1 SMP PREEMPT RT Debian 5.2.17-1
> (2019-09-26) x86_64 GNU/Linux
> $ btrfs --version
> btrfs-progs v5.2.1
> $ sudo btrfs filesystem show
> Label: none  uuid: 909c3fad-bc84-4b62-8090-ad1ae46f925e
> Total devices 2 FS bytes used 191.27GiB
> devid    1 size 200.00GiB used 197.03GiB path /dev/mapper/home-dom0
> devid    2 size 200.00GiB used 197.03GiB path /dev/mapper/home-dom0--mirror
> $ sudo btrfs filesystem df .
> Data, RAID1: total=193.00GiB, used=188.50GiB
> System, RAID1: total=32.00MiB, used=48.00KiB
> Metadata, RAID1: total=4.00GiB, used=2.77GiB
> GlobalReserve, single: total=385.31MiB, used=0.00B
> $ diff -u <(sudo btrfs ins dump-tree -b 739531833344 /dev/home/dom0)
> <(sudo btrfs ins dump-tree -b 739531833344 /dev/home/dom0-mirror)
> $ sudo btrfs ins dump-tree -b 739531833344 /dev/home/dom0
> (See attached file)
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to