Re: [PATCH 2/8] btrfs-progs: qgroups: fix misleading index check
On 2.03.2018 20:46, je...@suse.com wrote: > From: Jeff Mahoney > > 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. > > Signed-off-by: Jeff Mahoney Reviewed-by: Nikolay Borisov > --- > qgroup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/qgroup.c b/qgroup.c > index 11659e83..67bc0738 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"); > -- 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
[PATCH 2/8] btrfs-progs: qgroups: fix misleading index check
From: Jeff Mahoney 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. Signed-off-by: Jeff Mahoney --- qgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgroup.c b/qgroup.c index 11659e83..67bc0738 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"); -- 2.15.1 -- 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
[PATCH 2/8] btrfs-progs: qgroups: fix misleading index check
From: Jeff Mahoney 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. Signed-off-by: Jeff Mahoney --- qgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgroup.c b/qgroup.c index 11659e83..67bc0738 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"); -- 2.15.1 -- 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