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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ace2e8d7bbcd..eb89e1317aca 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -365,6 +365,7 @@ static noinline int device_list_add(const char *path,
365 struct btrfs_device *device; 365 struct btrfs_device *device;
366 struct btrfs_fs_devices *fs_devices; 366 struct btrfs_fs_devices *fs_devices;
367 u64 found_transid = btrfs_super_generation(disk_super); 367 u64 found_transid = btrfs_super_generation(disk_super);
368 char *name;
368 369
369 fs_devices = find_fsid(disk_super->fsid); 370 fs_devices = find_fsid(disk_super->fsid);
370 if (!fs_devices) { 371 if (!fs_devices) {
@@ -411,6 +412,12 @@ static noinline int device_list_add(const char *path,
411 412
412 device->fs_devices = fs_devices; 413 device->fs_devices = fs_devices;
413 fs_devices->num_devices++; 414 fs_devices->num_devices++;
415 } else if (strcmp(device->name, path)) {
416 name = kstrdup(path, GFP_NOFS);
417 if (!name)
418 return -ENOMEM;
419 kfree(device->name);
420 device->name = name;
414 } 421 }
415 422
416 if (found_transid > fs_devices->latest_trans) { 423 if (found_transid > fs_devices->latest_trans) {