From patchwork Fri Mar 2 18:46:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 10255423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 71887602B5 for ; Fri, 2 Mar 2018 18:47:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DA0C28161 for ; Fri, 2 Mar 2018 18:47:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5274828174; Fri, 2 Mar 2018 18:47:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05E2428161 for ; Fri, 2 Mar 2018 18:47:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947453AbeCBSrQ (ORCPT ); Fri, 2 Mar 2018 13:47:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:60086 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1947444AbeCBSrP (ORCPT ); Fri, 2 Mar 2018 13:47:15 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D94C9AE88 for ; Fri, 2 Mar 2018 18:47:13 +0000 (UTC) Received: from starscream.home.jeffm.io (starscream-1.home.jeffm.io [IPv6:2001:559:c0d4::1fe]) by mail.home.jeffm.io (Postfix) with ESMTPS id 1A86481AD3DE; Fri, 2 Mar 2018 13:46:49 -0500 (EST) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id C5F3D806FD; Fri, 2 Mar 2018 13:47:11 -0500 (EST) From: jeffm@suse.com To: linux-btrfs@vger.kernel.org Cc: Jeff Mahoney Subject: [PATCH 2/8] btrfs-progs: qgroups: fix misleading index check Date: Fri, 2 Mar 2018 13:46:58 -0500 Message-Id: <20180302184704.22399-3-jeffm@suse.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180302184704.22399-1-jeffm@suse.com> References: <20180302184704.22399-1-jeffm@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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");