public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] btrfs-progs: introduce a skeleton version of "btrfs rescue fix-data-csums"
@ 2025-05-11  6:48 Qu Wenruo
  2025-05-11  6:48 ` [PATCH 1/3] btrfs-progs: introduce " Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Qu Wenruo @ 2025-05-11  6:48 UTC (permalink / raw)
  To: linux-btrfs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-11  6:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-11  6:48 [PATCH 0/3] btrfs-progs: introduce a skeleton version of "btrfs rescue fix-data-csums" Qu Wenruo
2025-05-11  6:48 ` [PATCH 1/3] btrfs-progs: introduce " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox