summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2014-10-30 12:43:03 +0800
committerDavid Sterba <dsterba@suse.cz>2014-11-03 18:35:30 +0100
commitcfdb818ddacce999603081583d5ac163dafdaa33 (patch)
tree36ae7569d911a36ac60f8a7186eae2155825bc94 /utils.c
parentae8f7f687f037c46a9fc61cab5bdfea34419df26 (diff)
revert btrfs-progs: do a separate probe for _transient_ replacing device
There is a compatibility issue with older kernel with the progs commit id as below. d0588bfa479409b2a0f6243f894338a01a56221a btrfs-progs: do a separate probe for _transient_ replacing device So as of now writing to revert the above commit id. The brewing sysfs interface would help to fix the impending issue, which is seed device would fail show in 'btrfs fi show' output of a sprout device. Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/utils.c b/utils.c
index 33f3e2af..9ad1e17f 100644
--- a/utils.c
+++ b/utils.c
@@ -1867,29 +1867,12 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
if (!fi_args->num_devices)
goto out;
- /*
- * with kernel patch
- * btrfs: ioctl BTRFS_IOC_FS_INFO and BTRFS_IOC_DEV_INFO miss-matched with slots
- * the kernel now returns total_devices which does not include
- * replacing device if running.
- * As we need to get dev info of the replace device if it is running,
- * so just add one to fi_args->num_devices.
- */
-
- di_args = *di_ret = malloc((fi_args->num_devices + 1) * sizeof(*di_args));
+ di_args = *di_ret = malloc((fi_args->num_devices) * sizeof(*di_args));
if (!di_args) {
ret = -errno;
goto out;
}
- /* get the replace target device if it is there */
- ret = get_device_info(fd, i, &di_args[ndevs]);
- if (!ret) {
- ndevs++;
- fi_args->num_devices++;
- }
- i++;
-
for (; i <= fi_args->max_id; ++i) {
BUG_ON(ndevs >= fi_args->num_devices);
ret = get_device_info(fd, i, &di_args[ndevs]);