From 66d90453cd4a619095338585a6b221f57a7b18d9 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 16 May 2018 17:38:35 -0400 Subject: btrfs-progs: qgroups: fix misleading index check In print_single_qgroup_table we check the loop index against BTRFS_QGROUP_CHILD, but what we really mean is "last column." Since we have an enum value to indicate the last value, use that instead of assuming that BTRFS_QGROUP_CHILD is always last. Reviewed-by: Qu Wenruo Reviewed-by: Nikolay Borisov Signed-off-by: Jeff Mahoney Signed-off-by: David Sterba --- qgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgroup.c b/qgroup.c index 267cd7f1..3269feb2 100644 --- a/qgroup.c +++ b/qgroup.c @@ -267,7 +267,7 @@ static void print_single_qgroup_table(struct btrfs_qgroup *qgroup) continue; print_qgroup_column(qgroup, i); - if (i != BTRFS_QGROUP_CHILD) + if (i != BTRFS_QGROUP_ALL - 1) printf(" "); } printf("\n"); -- cgit v1.2.3