From patchwork Fri Oct 27 07:29:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10029297 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 C32CA60249 for ; Fri, 27 Oct 2017 07:29:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B628F28E39 for ; Fri, 27 Oct 2017 07:29:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB53728E3C; Fri, 27 Oct 2017 07:29:52 +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 6944428E39 for ; Fri, 27 Oct 2017 07:29:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014AbdJ0H3o (ORCPT ); Fri, 27 Oct 2017 03:29:44 -0400 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:54298 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751076AbdJ0H3n (ORCPT ); Fri, 27 Oct 2017 03:29:43 -0400 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Fri, 27 Oct 2017 01:29:40 -0600 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz Subject: [PATCH 1/8] btrfs-progs: qgroup-verify: Also repair qgroup status version Date: Fri, 27 Oct 2017 15:29:29 +0800 Message-Id: <20171027072936.4697-2-wqu@suse.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171027072936.4697-1-wqu@suse.com> References: <20171027072936.4697-1-wqu@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 Current kernel only supports qgroup version 1. Make qgroup-verify to follow this standard. Signed-off-by: Qu Wenruo --- ctree.h | 1 + qgroup-verify.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ctree.h b/ctree.h index 22806599a744..506b76766579 100644 --- a/ctree.h +++ b/ctree.h @@ -1011,6 +1011,7 @@ struct btrfs_qgroup_status_item { __le64 rescan; /* progress during scanning */ } __attribute__ ((__packed__)); +#define BTRFS_QGROUP_STATUS_VERSION 1 struct btrfs_block_group_item { __le64 used; __le64 chunk_objectid; diff --git a/qgroup-verify.c b/qgroup-verify.c index 571b4d4f7171..58c735788977 100644 --- a/qgroup-verify.c +++ b/qgroup-verify.c @@ -1563,6 +1563,8 @@ static int repair_qgroup_status(struct btrfs_fs_info *info) btrfs_set_qgroup_status_rescan(path.nodes[0], status_item, 0); btrfs_set_qgroup_status_generation(path.nodes[0], status_item, trans->transid); + btrfs_set_qgroup_status_version(path.nodes[0], status_item, + BTRFS_QGROUP_STATUS_VERSION); btrfs_mark_buffer_dirty(path.nodes[0]);