btrfs-progs: subvol list: don't print deleted subvol as TOPLEVEL
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Fri, 13 Oct 2017 09:17:22 +0000 (17:17 +0800)
committerDavid Sterba <dsterba@suse.com>
Fri, 13 Oct 2017 18:16:03 +0000 (20:16 +0200)
We should use entry->root_id instead of top_id to determine whether it is
the toplevel subvolume. Introduced in 4.13.2.

Issue: #72
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
btrfs-list.c

index dd917a3..b6d7658 100644 (file)
@@ -1273,7 +1273,7 @@ static void filter_and_sort_subvol(struct root_lookup *all_subvols,
 
                ret = resolve_root(all_subvols, entry, top_id);
                if (ret == -ENOENT) {
-                       if (top_id != BTRFS_FS_TREE_OBJECTID) {
+                       if (entry->root_id != BTRFS_FS_TREE_OBJECTID) {
                                entry->full_path = strdup("DELETED");
                                entry->deleted = 1;
                        } else {