linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] btrfs-progs: fix bugs and CHANGING_FSID_V2 flag
@ 2023-07-07 15:52 Anand Jain
  2023-07-07 15:52 ` [PATCH 01/11] btrfs-progs: fix duplicate missing device Anand Jain
                   ` (10 more replies)
  0 siblings, 11 replies; 22+ messages in thread
From: Anand Jain @ 2023-07-07 15:52 UTC (permalink / raw)
  To: linux-btrfs

Btrfstune currently lacks support for fixing incomplete or broken
previous runs. Instead, it relies on the kernel to assemble the
correct set of devices based on metadata_uuid, generation, and
the CHANGE_FSID_V2 flag.

However, depending on the kernel to handle this interim change_fsid
state may not be suitable for all situations. For instance, if
there are other fsids sharing the same metadata_uuid but are not
part of the incomplete fsid, the assembly process in the kernel
may not be transparent or controllable to the user. So, this patch
set bring the ability to fix incomplete fsid changes to the userland
using btrfstune.

This patch set fixes bugs as in the individual change log,
introduces new fs_devices members and helper functions, and
the last patch provides the feature discussed.

To ensure proper device assembly and to mitigate any potential
incorrect assembly this feature is behind the --noscan and
--device options. And calls automatically, however I am ok to
add another option like --fix-changing_fsid if you think it
makes sense. However, I don't think it is needed as of now
the kernel does it with all normal options.

This patch set depends on:

 --noscan and --device option:
  [PATCH 00/10] btrfs-progs: check and tune: add device and noscan options


Testing:

The btrfs-progs tests/misc-tests/034-metadata_uuid include a series of 4
disk images that contain incomplete fsid states (changing_fsid).

To evaluate this patch set, the images were tested using a local script,
which is not yet prepared for submission.

The typical testing steps involve:

	xz --uncompress --keep <imgs>

	btrfstune -m --noscan --device=disk1.raw disk2.raw
	btrfstune -m --noscan --device=disk2.raw disk1.raw

	btrfstune -m --noscan --device=disk3.raw disk4.raw
	btrfstune -m --noscan --device=disk4.raw disk3.raw

	and so on.

I plan to migrate misc-test/034-metadata_uuid test cases to assess
btrfstune, as the kernel's support for fixing the changing_fsid state
will be removed.

This patch set has successfully passed the btrfs-progs test cases.

Thanks.

Anand Jain (11):
  btrfs-progs: fix duplicate missing device
  btrfs-progs: call warn() for missing device
  btrfs-progs: track missing device counter
  btrfs-progs: NULL initialize device name for missing
  btrfs-progs: tune: check for missing device
  btrfs-progs: track changing_fsid flag in fs_devices
  btrfs-progs: track num_devices per fs_devices
  btrfs-progs: track total_devs in fs devices
  btrfs-progs: track active metadata_uuid per fs_devices
  btrfs-progs: add helper to reunite devices with same metadata_uuid
  btrfs-progs: tune: fix incomplete fsid_change

 common/device-scan.c        | 42 ++++++++++++++++
 common/device-scan.h        |  1 +
 kernel-shared/volumes.c     | 99 +++++++++++++++++++++++++++++++++++--
 kernel-shared/volumes.h     |  8 +++
 tune/change-metadata-uuid.c |  4 +-
 tune/change-uuid.c          |  4 +-
 tune/main.c                 | 16 +++++-
 7 files changed, 166 insertions(+), 8 deletions(-)

-- 
2.39.3


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

end of thread, other threads:[~2023-07-20 14:34 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-07 15:52 [PATCH 00/11] btrfs-progs: fix bugs and CHANGING_FSID_V2 flag Anand Jain
2023-07-07 15:52 ` [PATCH 01/11] btrfs-progs: fix duplicate missing device Anand Jain
2023-07-07 15:52 ` [PATCH 02/11] btrfs-progs: call warn() for " Anand Jain
2023-07-13 18:48   ` David Sterba
2023-07-17 18:22     ` Anand Jain
2023-07-19 14:34       ` Anand Jain
2023-07-07 15:52 ` [PATCH 03/11] btrfs-progs: track missing device counter Anand Jain
2023-07-07 15:52 ` [PATCH 04/11] btrfs-progs: NULL initialize device name for missing Anand Jain
2023-07-07 15:52 ` [PATCH 05/11] btrfs-progs: tune: check for missing device Anand Jain
2023-07-13 18:49   ` David Sterba
2023-07-17 19:02     ` Anand Jain
2023-07-07 15:52 ` [PATCH 06/11] btrfs-progs: track changing_fsid flag in fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 07/11] btrfs-progs: track num_devices per fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 08/11] btrfs-progs: track total_devs in fs devices Anand Jain
2023-07-13 18:58   ` David Sterba
2023-07-17 19:28     ` Anand Jain
2023-07-07 15:52 ` [PATCH 09/11] btrfs-progs: track active metadata_uuid per fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 10/11] btrfs-progs: add helper to reunite devices with same metadata_uuid Anand Jain
2023-07-07 15:52 ` [PATCH 11/11] btrfs-progs: tune: fix incomplete fsid_change Anand Jain
2023-07-13 18:57   ` David Sterba
2023-07-17 19:25     ` Anand Jain
2023-07-20 14:33       ` Anand Jain

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 NNTP newsgroup(s).