From patchwork Fri Aug 9 06:53:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 11085439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 50D6214D5 for ; Fri, 9 Aug 2019 06:53:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F48228C33 for ; Fri, 9 Aug 2019 06:53:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 325D328C31; Fri, 9 Aug 2019 06:53:34 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 CC16128C31 for ; Fri, 9 Aug 2019 06:53:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405611AbfHIGxc (ORCPT ); Fri, 9 Aug 2019 02:53:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:38116 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728823AbfHIGxc (ORCPT ); Fri, 9 Aug 2019 02:53:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 268FBB03B for ; Fri, 9 Aug 2019 06:53:31 +0000 (UTC) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 0/3] btrfs-progs: Check and repair invalid root item generation Date: Fri, 9 Aug 2019 14:53:17 +0800 Message-Id: <20190809065320.22702-1-wqu@suse.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 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 Kernel is going to reject invalid root generation. Consider the existing checks are causing some error reports, we should handle such problem in advance, so that's the patchset is going to do, check and repair such invalid root generation. Qu Wenruo (3): btrfs-progs: check/lowmem: Check and repair root generation btrfs-progs: check/original: Check and repair root item geneartion btrfs-progs: fsck-tests: Add test case for invalid root generation check/main.c | 20 ++++++++++++ check/mode-common.c | 29 ++++++++++++++++++ check/mode-common.h | 1 + check/mode-lowmem.c | 16 ++++++++++ check/mode-lowmem.h | 1 + .../default_case.img | Bin 0 -> 3072 bytes 6 files changed, 67 insertions(+) create mode 100644 tests/fsck-tests/041-invalid-root-generation/default_case.img