btrfs-progs: subvol list: don't print deleted subvol as TOPLEVEL
diff mbox

Message ID 20171013091722.2988-1-lufq.fnst@cn.fujitsu.com
State New
Headers show

Commit Message

Lu Fengqi Oct. 13, 2017, 9:17 a.m. UTC
We should use entry->root_id instead of top_id to determine whether it is
the toplevel subvolume.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
---
 btrfs-list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Sterba Oct. 13, 2017, 6:13 p.m. UTC | #1
On Fri, Oct 13, 2017 at 05:17:22PM +0800, Lu Fengqi wrote:
> We should use entry->root_id instead of top_id to determine whether it is
> the toplevel subvolume.
> 
> Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

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

Patch
diff mbox

diff --git a/btrfs-list.c b/btrfs-list.c
index 6f2d8774..4ea8edfd 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -1279,7 +1279,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 {