public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs-progs: introduce a skeleton version of "btrfs rescue fix-data-csums"
Date: Sun, 11 May 2025 16:18:18 +0930	[thread overview]
Message-ID: <cover.1746945864.git.wqu@suse.com> (raw)

We have a long history of data csum mismatch, caused by direct IO and
buffered being modified during writeback.

Although the problem is worked around in v6.15 (and being backported),
for the affected fs there is no good way to fix them, other than complex
manually find out which files are affected and delete them.

This series introduce the initial implementation of "btrfs rescue
fix-data-csums", which is designed to fix such problem by either:

- Delete the affected files
- Update the csum items using the data from specified copy

But for the first step, just detect such csum mismatch (pretty much the
same as "btrfs check --check-data-csum"), and print out the affected
files.

No real repair is done yet, only dry run is supported (the default and
only mode yet).

Qu Wenruo (3):
  btrfs-progs: introduce "btrfs rescue fix-data-csums"
  btrfs-progs: fix a bug in btrfs_find_item()
  btrfs-progs: fix-data-csums: show affected files

 Documentation/btrfs-rescue.rst |  19 ++
 Makefile                       |   2 +-
 cmds/rescue-fix-data-csums.c   | 379 +++++++++++++++++++++++++++++++++
 cmds/rescue.c                  |  44 ++++
 cmds/rescue.h                  |   6 +
 kernel-shared/ctree.c          |  17 +-
 6 files changed, 463 insertions(+), 4 deletions(-)
 create mode 100644 cmds/rescue-fix-data-csums.c

--
2.49.0


             reply	other threads:[~2025-05-11  6:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-11  6:48 Qu Wenruo [this message]
2025-05-11  6:48 ` [PATCH 1/3] btrfs-progs: introduce "btrfs rescue fix-data-csums" Qu Wenruo
2025-05-11  6:48 ` [PATCH 2/3] btrfs-progs: fix a bug in btrfs_find_item() Qu Wenruo
2025-05-11  6:48 ` [PATCH 3/3] btrfs-progs: fix-data-csums: show affected files 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=cover.1746945864.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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