Linux-BTRFS Archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/3] btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents
Date: Fri, 3 May 2024 15:29:39 +0200	[thread overview]
Message-ID: <20240503132939.GA2585@twin.jikos.cz> (raw)
In-Reply-To: <cover.1714640642.git.wqu@suse.com>

On Thu, May 02, 2024 at 06:37:52PM +0930, Qu Wenruo wrote:
> There are at least one kernel bug that makes on-disk
> btrfs_file_extent_item::ram_bytes incorrect for non-compressed non-hole
> data extents.
> 
> Thankfully kernel just doesn't care ram_bytes for non-compressed extents
> at all, so it doesn't lead to any data corruption or whatever, and this
> is really just a minor problem.
> 
> But for the sake of consistency and to follow the on-disk format, we
> should still detect and repair such problems.
> 
> This patchset would implement detection and repair for both lowmem and
> original mode, and a new hand crafted test case for it.
> 
> The reason why the test case is still handle crafted is, we do not have
> the btrfs-corrupt-block support for corrupting ram_bytes to a specific
> value yet.
> 
> I'd prefer to do the binary image migration to script in a dedicated
> patchset in the future.

The crafted binary images are ok for now, I've verified it by restoring,
did tree dump and check.

There's an issue tracking the other images audit,
https://github.com/kdave/btrfs-progs/issues/772, I did only a quick pass
but a tool that will do the restore/check and maybe some other steps
will be added to the repository.

Patches added to devel, thanks.

      parent reply	other threads:[~2024-05-03 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-02  9:07 [PATCH 0/3] btrfs-progs: check: detect and repair ram_bytes mismatch for non-compressed data extents Qu Wenruo
2024-05-02  9:07 ` [PATCH 1/3] btrfs-progs: check/lowmem: detect and repair mismatched ram_bytes Qu Wenruo
2024-05-02  9:07 ` [PATCH 2/3] btrfs-progs: check/original: detect and repair ram_bytes mismatch Qu Wenruo
2024-05-02  9:07 ` [PATCH 3/3] btrfs-progs: tests/fsck: add test case for ram_bytes detection and repair Qu Wenruo
2024-05-03 13:29 ` David Sterba [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=20240503132939.GA2585@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --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 read-only IMAP folder(s) and NNTP newsgroup(s).