Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Marcus Lell <marcus.lell@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: regressions@lists.linux.dev
Subject: btrfs corruption across different storage configurations. Both with free addressable free storage.
Date: Mon, 23 Nov 2026 10:46:58 +0100	[thread overview]
Message-ID: <b8b122c5-87c7-4363-b3cc-c91d24ff4d2d@gmail.com> (raw)

[please CC me, as I'm off list]

I know it's a late report, but I thought, you may know about this one...

I experienced severe Btrfs corruption twice, on Linux 7.1.10 and 7.1.12, using substantially different storage configurations.

Incident 1 — Linux 7.1.10

I was running Btrfs on LUKS/dm-crypt over md RAID5, using four SATA devices with 64 KiB chunks. The incident occurred during or after a RAID5 reshape and enlargement of the encrypted device. After enlarging the crypt layer, I tried mounting the filesystem, but "mount.btrfs" failed.

Subsequent diagnostics revealed metadata errors at offsets beyond Btrfs's reported size:

"total_bytes = 20001389936640"

- Wanted bytenr "20015028908032", found "8567551700635656859"; checksum wanted "0x836ea028", found "0x8db80d65".
- Wanted bytenr "20024023199744", found "12778909791338521120"; checksum wanted "0xfd168e20", found "0x95744024".

These offsets were approximately 13.65 GB and 22.64 GB beyond the reported filesystem size, but within the underlying device's addressable capacity.

I did not touch the underlying filesystem during the enlargement. Just at the end. I was surprised, that an untouched filesystem could go so messed up. I thought, it could be an mdadm grow failure.

I made extensive attempts to diagnose and recover the filesystem. I tried superblock recovery, "btrfs check --repair", "btrfs restore", "btrfs-find-root", mounting with recovery options, and "dmsetup"-based approaches. I also used a device-mapper snapshot to rule out concurrent changes during checking. Despite these efforts, I could not restore a usable filesystem. "btrfs restore" recovered some files but reported checksum errors.

Incident 2 — Linux 7.1.12

I was running Btrfs on an approximately 1 TB root logical volume on LVM, on a single 2 TB NVMe device, without md RAID. The root filesystem became unusable. I recall seeing what appeared to be the same kind of "bytenr" failure, although I no longer have the logs to confirm the exact error. I had not observed unusually large writes before the failure.

I lost the logs of the first attempt, that I saved on the root partition. I was like to be afraid to cope with the responses of you. (I'm shy)

Because the second incident occurred on a substantially different storage configuration, I find it less likely that the problem was specific to the RAID reshape or crypt-layer resizing in the first incident.

I want you to help make the btrfs filesystem more error prone. But I can only point into the direction. I cannot prove that such a write occurred or that both incidents shared the same root cause, but I believe the recurrence and the first incident's specific offsets warrant investigation.

I don't know, how to help further, but I don't dare to trust Linux 7.1.x and successors, with 7.0.x I believe, this is the last stable one. I need to upgrade sooner or later, so please find the root cause of this behavior...

Marcus Lell


-- 
Return to the point of no return._

-- 
Return to the point of no return._

             reply	other threads:[~2026-11-23  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  9:46 Marcus Lell [this message]
     [not found] ` <CAC=1GgHNn17ygWL0tF26LGm+=5M4KrKoeMpq9YE794EothX++w@mail.gmail.com>
2026-11-25 20:41   ` btrfs corruption across different storage configurations. Both with free addressable free storage Marcus Lell

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=b8b122c5-87c7-4363-b3cc-c91d24ff4d2d@gmail.com \
    --to=marcus.lell@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    /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