path: root/cmds-subvolume.c
diff options
authorWang Shilong <>2012-09-28 01:04:20 +0800
committerroot <root@localhost.localdomain>2012-10-04 16:26:33 -0400
commita1e89891eb6af5381539d9875b85c196150171b6 (patch)
treea6d8ba8fd0874e0fffc8c42593492a37b2b4188e /cmds-subvolume.c
parent0f53cf81f66f4b62f68661f0d5a1a919b1db2686 (diff)
Btrfs-Progs: fix subvolumes's some full_path invaild problems.
In the privous way, we list all the subvolumes in the filesystem default. But if a subvolume mounts on another directory, some result's full_path may be invaild. According to this, we try to list subvolumes under directoy only by default. In this way, all the subvolume can be arrived by the full_path. Signed-off-by: Wang Shilong <>
Diffstat (limited to 'cmds-subvolume.c')
1 files changed, 6 insertions, 0 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 8399e72e..b96af3eb 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -289,6 +289,7 @@ static int cmd_subvol_list(int argc, char **argv)
struct btrfs_list_comparer_set *comparer_set;
u64 flags = 0;
int fd;
+ u64 top_id;
int ret;
int order;
int c;
@@ -387,6 +388,11 @@ static int cmd_subvol_list(int argc, char **argv)
return 12;
+ top_id = btrfs_list_get_path_rootid(fd);
+ btrfs_list_setup_filter(&filter_set,
+ top_id);
ret = btrfs_list_subvols(fd, filter_set, comparer_set,
if (ret)