From 0ba68fa235fffe61b4af74372bf932044dafa199 Mon Sep 17 00:00:00 2001 From: TARUISI Hiroaki Date: Tue, 9 Feb 2010 06:36:45 +0000 Subject: [PATCH] --- yaml --- r: 188218 b: refs/heads/master c: 3a0524dc054791688177544fe510d2868ee20d9f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/volumes.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 2f2189eb4556..e8c8201895ad 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1e701a3292e25a6c4939cad9f24951dc6b6ad853 +refs/heads/master: 3a0524dc054791688177544fe510d2868ee20d9f diff --git a/trunk/fs/btrfs/volumes.c b/trunk/fs/btrfs/volumes.c index ace2e8d7bbcd..eb89e1317aca 100644 --- a/trunk/fs/btrfs/volumes.c +++ b/trunk/fs/btrfs/volumes.c @@ -365,6 +365,7 @@ static noinline int device_list_add(const char *path, struct btrfs_device *device; struct btrfs_fs_devices *fs_devices; u64 found_transid = btrfs_super_generation(disk_super); + char *name; fs_devices = find_fsid(disk_super->fsid); if (!fs_devices) { @@ -411,6 +412,12 @@ static noinline int device_list_add(const char *path, device->fs_devices = fs_devices; fs_devices->num_devices++; + } else if (strcmp(device->name, path)) { + name = kstrdup(path, GFP_NOFS); + if (!name) + return -ENOMEM; + kfree(device->name); + device->name = name; } if (found_transid > fs_devices->latest_trans) {