diff mbox series

[09/16] btrfs-progs: fix return without flag reset commit in tune

Message ID 6b871014a82f276ee239e01c29d94450ee297350.1692018849.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: recover from failed metadata_uuid | expand

Commit Message

Anand Jain Aug. 14, 2023, 3:28 p.m. UTC
In the function set_metadata_uuid(), we set the flag
BTRFS_SUPER_FLAG_CHANGING_FSID_V2 in step 1 at line 71 as shown below:

   71         super_flags |= BTRFS_SUPER_FLAG_CHANGING_FSID_V2;
   72         btrfs_set_super_flags(disk_super, super_flags);
   73         ret = btrfs_commit_transaction(trans, root);

However, we fail to reset this flag if there is no change in the fsid on
the incoming disks, as we return too early.

  105       } else {
  106               /* Setting the same fsid as current, do nothing */
  107               return 0;

Fix this by allowing the thread to pass through the step 2, where we
reset the flag.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tune/change-metadata-uuid.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/tune/change-metadata-uuid.c b/tune/change-metadata-uuid.c
index b161f6757d13..ada3149ad549 100644
--- a/tune/change-metadata-uuid.c
+++ b/tune/change-metadata-uuid.c
@@ -92,9 +92,6 @@  int set_metadata_uuid(struct btrfs_root *root, const char *new_fsid_string)
 		memcpy(disk_super->metadata_uuid, disk_super->fsid,
 		       BTRFS_FSID_SIZE);
 		memcpy(disk_super->fsid, &fsid, BTRFS_FSID_SIZE);
-	} else {
-		/* Setting the same fsid as current, do nothing */
-		return 0;
 	}
 
 	trans = btrfs_start_transaction(root, 1);