All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs-progs: only allow certain commands to ignore transid errors
@ 2021-09-08  2:05 Qu Wenruo
  2021-09-08  2:05 ` [PATCH 1/2] btrfs-progs: introduce OPEN_CTREE_ALLOW_TRANSID_MISMATCH flag Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Qu Wenruo @ 2021-09-08  2:05 UTC (permalink / raw)
  To: linux-btrfs

There is a bug in reddit (well, really the last place I expect to see
bug reports), that btrfstune -u fails due to transid error, but it also
leaves CHANGING_FSID flag to the super block, prevent btrfs-check to
properly check the fs.

The problem is, all commands in btrfs-progs can ignore transid error,
but there are only very limited usage of such ability.

Btrfstune definitely should not utilize this feature.

This patchset will introduce a new open ctree flag to explicitly
indicate we want to ignore transid errors.

Currently only there are only 3 tools using this feature:

- btrfs-check
  It may fix transid error (at least for the specific test case)

- btrfs-restore
  It wants to ignore all errors.

- btrfs-image
  To make fsck/002 happy.

Also add a test case for btrfstune, to make sure btrfstune can rejects
the fs when an obvious transid mismatch is detected during open_ctree().

Qu Wenruo (2):
  btrfs-progs: introduce OPEN_CTREE_ALLOW_TRANSID_MISMATCH flag
  btrfs-progs: misc-tests: add new test case to make sure btrfstune
    rejects corrupted fs

 check/main.c                                     |  3 ++-
 cmds/restore.c                                   |  3 ++-
 image/main.c                                     | 11 +++++++----
 kernel-shared/ctree.h                            |  1 +
 kernel-shared/disk-io.c                          | 11 +++++++++--
 kernel-shared/disk-io.h                          |  6 ++++++
 .../default_case.img                             |  1 +
 .../049-btrfstune-transid-mismatch/test.sh       | 16 ++++++++++++++++
 8 files changed, 44 insertions(+), 8 deletions(-)
 create mode 120000 tests/misc-tests/049-btrfstune-transid-mismatch/default_case.img
 create mode 100755 tests/misc-tests/049-btrfstune-transid-mismatch/test.sh

-- 
2.33.0


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

end of thread, other threads:[~2021-09-20 11:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  2:05 [PATCH 0/2] btrfs-progs: only allow certain commands to ignore transid errors Qu Wenruo
2021-09-08  2:05 ` [PATCH 1/2] btrfs-progs: introduce OPEN_CTREE_ALLOW_TRANSID_MISMATCH flag Qu Wenruo
2021-09-08  2:05 ` [PATCH 2/2] btrfs-progs: misc-tests: add new test case to make sure btrfstune rejects corrupted fs Qu Wenruo
2021-09-20 10:43 ` [PATCH 0/2] btrfs-progs: only allow certain commands to ignore transid errors David Sterba
2021-09-20 11:01   ` Qu Wenruo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.