[PATCH] btrfs-progs: btrfstune: Register new UUIDs after uuid change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For multi-device btrfs, after UUID change we should info kernel, or new
fs can't be mounted due to false alert on missing devices.

Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
---
 btrfstune.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/btrfstune.c b/btrfstune.c
index 15dde90..23d06ce 100644
--- a/btrfstune.c
+++ b/btrfstune.c
@@ -369,6 +369,15 @@ static int change_uuid(struct btrfs_fs_info *fs_info, const char *new_fsid_str)
 	fs_info->new_fsid = NULL;
 	fs_info->new_chunk_tree_uuid = NULL;
 	printf("Fsid change finished\n");
+
+	/*
+	 * Register new devices, or multi-volume btrfs can't be mounted until
+	 * device scan happens.
+	 * Ignore any error, as such register is optional.
+	 */
+	printf("Register new UUIDs(error can be ignored)\n");
+	btrfs_register_all_devices();
+
 out:
 	return ret;
 }
-- 
2.10.0



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux