From b96345c7ff452fe0b37a503d16072fdebf96d2fd Mon Sep 17 00:00:00 2001 From: Goffredo Baroncelli Date: Wed, 17 Dec 2014 21:14:08 +0100 Subject: 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 Reviewed-by: Satoru Takeuchi Signed-off-by: David Sterba --- utils.c | 1 + 1 file changed, 1 insertion(+) (limited to 'utils.c') diff --git a/utils.c b/utils.c index 61a9cd9..ef27c51 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); -- cgit v1.2.1