Allow "fi show -u" for uuid of top-level subvolume too for consistency.

Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
---
 btrfs-list.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/btrfs-list.c b/btrfs-list.c
index b6d7658..91fdab8 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -1594,9 +1594,15 @@ int btrfs_get_subvol(int fd, struct root_info *the_ri)
                ri = rb_entry(rbn, struct root_info, rb_node);
                rr = resolve_root(&rl, ri, root_id);
                if (rr == -ENOENT) {
-                       ret = -ENOENT;
-                       rbn = rb_next(rbn);
-                       continue;
+                       if (ri->root_id == BTRFS_FS_TREE_OBJECTID) {
+                               ri->path = strdup("/");
+                               ri->name = strdup("<FS_TREE>");
+                               ri->full_path = strdup("/");
+                       } else {
+                               ret = -ENOENT;
+                               rbn = rb_next(rbn);
+                               continue;
+                       }
                }
 
                if (!comp_entry_with_rootid(the_ri, ri, 0) ||
-- 
2.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to