summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffredo Baroncelli <kreijack@gmail.com>2014-12-17 21:14:08 +0100
committerDavid Sterba <dsterba@suse.cz>2015-06-08 17:50:46 +0200
commitb96345c7ff452fe0b37a503d16072fdebf96d2fd (patch)
treec0a64b64c3cad503262208e204bfcdeb68d8a273
parent1bcedaae799d117957e36f8ffddc0d9d84274c2d (diff)
btrfs-progs: add strdup in btrfs_add_to_fsid() to track the device path
When creating a new btrfs_device, copy the path to track it. This path is then used by mkfs.btrfs to list all devices. Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it> Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
-rw-r--r--utils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 61a9cd93..ef27c51e 100644
--- a/utils.c
+++ b/utils.c
@@ -750,6 +750,7 @@ int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
device->bytes_used = 0;
device->total_ios = 0;
device->dev_root = root->fs_info->dev_root;
+ device->name = strdup(path);
ret = btrfs_add_device(trans, root, device);
BUG_ON(ret);