aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 19b67e969b52..6ca0d9cc46f9 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2154,6 +2154,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
2154 mutex_unlock(&root->fs_info->fs_devices->device_list_mutex); 2154 mutex_unlock(&root->fs_info->fs_devices->device_list_mutex);
2155 2155
2156 if (seeding_dev) { 2156 if (seeding_dev) {
2157 char fsid_buf[BTRFS_UUID_UNPARSED_SIZE];
2157 ret = init_first_rw_device(trans, root, device); 2158 ret = init_first_rw_device(trans, root, device);
2158 if (ret) { 2159 if (ret) {
2159 btrfs_abort_transaction(trans, root, ret); 2160 btrfs_abort_transaction(trans, root, ret);
@@ -2164,6 +2165,14 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
2164 btrfs_abort_transaction(trans, root, ret); 2165 btrfs_abort_transaction(trans, root, ret);
2165 goto error_trans; 2166 goto error_trans;
2166 } 2167 }
2168
2169 /* Sprouting would change fsid of the mounted root,
2170 * so rename the fsid on the sysfs
2171 */
2172 snprintf(fsid_buf, BTRFS_UUID_UNPARSED_SIZE, "%pU",
2173 root->fs_info->fsid);
2174 if (kobject_rename(&root->fs_info->super_kobj, fsid_buf))
2175 goto error_trans;
2167 } else { 2176 } else {
2168 ret = btrfs_add_device(trans, root, device); 2177 ret = btrfs_add_device(trans, root, device);
2169 if (ret) { 2178 if (ret) {