mbox series

[v2,0/9] btrfs: metadata_uuid refactors part1

Message ID cover.1684928629.git.anand.jain@oracle.com (mailing list archive)
Headers show
Series btrfs: metadata_uuid refactors part1 | expand

Message

Anand Jain May 24, 2023, 12:02 p.m. UTC
v2: Addressed the review comments received on some patches. Please refer
    to the individual patches for more details.

The metadata_uuid feature added later has significantly impacted code
readability due to the numerous conditions that need to be checked.

This patch set aims to improve code organization and prepares for
streamlining of the metadata_uuid checks and some simple fixes.

Anand Jain (9):
  btrfs: reduce struct btrfs_fs_devices size relocate fsid_change
  btrfs: streamline fsid checks in alloc_fs_devices
  btrfs: localise has_metadata_uuid check in alloc_fs_devices args
  btrfs: add comment about metadata_uuid in btrfs_fs_devices
  btrfs: simplify check_tree_block_fsid return arg to bool
  btrfs: refactor with match_fsid_fs_devices helper
  btrfs: refactor with match_fsid_changed helper
  btrfs: consolidate uuid memcmp in btrfs_validate_super
  btrfs: add and fix comments in btrfs_fs_devices

 fs/btrfs/disk-io.c |  24 +++++-----
 fs/btrfs/volumes.c | 110 +++++++++++++++++++++++++--------------------
 fs/btrfs/volumes.h |  37 ++++++++++-----
 3 files changed, 99 insertions(+), 72 deletions(-)

Comments

David Sterba May 24, 2023, 8:57 p.m. UTC | #1
On Wed, May 24, 2023 at 08:02:34PM +0800, Anand Jain wrote:
> v2: Addressed the review comments received on some patches. Please refer
>     to the individual patches for more details.
> 
> The metadata_uuid feature added later has significantly impacted code
> readability due to the numerous conditions that need to be checked.
> 
> This patch set aims to improve code organization and prepares for
> streamlining of the metadata_uuid checks and some simple fixes.
> 
> Anand Jain (9):
>   btrfs: reduce struct btrfs_fs_devices size relocate fsid_change
>   btrfs: streamline fsid checks in alloc_fs_devices
>   btrfs: localise has_metadata_uuid check in alloc_fs_devices args
>   btrfs: add comment about metadata_uuid in btrfs_fs_devices
>   btrfs: simplify check_tree_block_fsid return arg to bool
>   btrfs: refactor with match_fsid_fs_devices helper
>   btrfs: refactor with match_fsid_changed helper
>   btrfs: consolidate uuid memcmp in btrfs_validate_super
>   btrfs: add and fix comments in btrfs_fs_devices

Added to misc-next with some minor adjustments, thanks.
Guilherme G. Piccoli June 27, 2023, 2:55 p.m. UTC | #2
Hi Anand, thanks for the patches, nice clean-ups / improvements!

I'm working in the same-fsid mounting [0] (guess you even commented
there already) and that touches a lot the metadata_uuid/fsid related code.

So I'd like to ask if you maybe have a "part 2" ready or almost ready,
in order I can merge it and work on top of that, avoiding too much
conflicts later.

Thanks in advance!


Guilherme


[0]
https://lore.kernel.org/linux-btrfs/20230504170708.787361-1-gpiccoli@igalia.com/
Anand Jain June 28, 2023, 3:52 a.m. UTC | #3
I have a few items still in progress, and I should be sending
them out this week. The main focus is on cleaning up the usage
of the CHANGING_FSID flag. However, it also requires changes
in the btrfs-progs and testing, which is taking longer than
I anticipated. Thank you for your patience.

Thanks, - Anand


On 27/06/2023 22:55, Guilherme G. Piccoli wrote:
> Hi Anand, thanks for the patches, nice clean-ups / improvements!
> 
> I'm working in the same-fsid mounting [0] (guess you even commented
> there already) and that touches a lot the metadata_uuid/fsid related code.
> 
> So I'd like to ask if you maybe have a "part 2" ready or almost ready,
> in order I can merge it and work on top of that, avoiding too much
> conflicts later.
> 
> Thanks in advance!
> 
> 
> Guilherme
> 
> 
> [0]
> https://lore.kernel.org/linux-btrfs/20230504170708.787361-1-gpiccoli@igalia.com/
Guilherme G. Piccoli June 28, 2023, 1:07 p.m. UTC | #4
On 28/06/2023 05:52, Anand Jain wrote:
> 
> 
> I have a few items still in progress, and I should be sending
> them out this week. The main focus is on cleaning up the usage
> of the CHANGING_FSID flag. However, it also requires changes
> in the btrfs-progs and testing, which is taking longer than
> I anticipated. Thank you for your patience.
> 
> Thanks, - Anand
> 

Thanks Anand, no hurries at all. Was just in case you already had a
branch somewhere, I could pick it and work on top of that. But instead
I'm working now on top of "6.5-rc1", which already includes part 1.

It's good and I can fix conflicts later, not a biggie. Thanks for the
very useful refactor, I confess I found the metadata_uuid stuff a bit
confusing to read, code is now better =)

Cheers!