linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: btrfstune: Register new UUIDs after uuid change
@ 2016-10-10  9:21 Qu Wenruo
  2016-10-10 10:54 ` Anand Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Qu Wenruo @ 2016-10-10  9:21 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba

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@cn.fujitsu.com>
---
 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




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

end of thread, other threads:[~2016-10-10 13:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-10  9:21 [PATCH] btrfs-progs: btrfstune: Register new UUIDs after uuid change Qu Wenruo
2016-10-10 10:54 ` Anand Jain
2016-10-10 11:08   ` David Sterba
2016-10-10 13:58     ` 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).