From patchwork Thu Jun 22 08:12:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 9803755 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 B36C3600C5 for ; Thu, 22 Jun 2017 08:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A73AF285BE for ; Thu, 22 Jun 2017 08:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BC13285D1; Thu, 22 Jun 2017 08:13:06 +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 EEF9C285BE for ; Thu, 22 Jun 2017 08:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752727AbdFVINC (ORCPT ); Thu, 22 Jun 2017 04:13:02 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:25504 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752667AbdFVINB (ORCPT ); Thu, 22 Jun 2017 04:13:01 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20357444" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 22 Jun 2017 16:12:59 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 5FE9B47CA8C0; Thu, 22 Jun 2017 16:13:00 +0800 (CST) Received: from localhost.localdomain (10.167.225.63) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 22 Jun 2017 16:12:59 +0800 From: Lu Fengqi To: CC: Subject: [PATCH v2] btrfs-progs: lowmem check: Fix false alert about file extent interrupt Date: Thu, 22 Jun 2017 16:12:56 +0800 Message-ID: <20170622081256.4981-1-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170622075237.1852-1-lufq.fnst@cn.fujitsu.com> References: <20170622075237.1852-1-lufq.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.225.63] X-yoursite-MailScanner-ID: 5FE9B47CA8C0.AD808 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.fnst@cn.fujitsu.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 As Qu mentioned in this thread (https://www.spinics.net/lists/linux-btrfs/msg64469.html), compression can cause regular extent to co-exist with inlined extent. This coexistence makes things confusing. Since it was permitted currently, so fix btrfsck to prevent a bunch of error logs that will make user feel panic. When check file extent, record the extent_end of regular extent to check if there is a gap between the regular extents. Normally there is only one inlined extent, so the extent_end of inlined extent is useless. However, if regular extent can co-exist with inlined extent, the extent_end of inlined extent also need to record. Reported-by: Marc MERLIN Signed-off-by: Lu Fengqi --- Sorry, I mistook the reporter in v1. Changes since v1: - Fix the reported-by. cmds-check.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-check.c b/cmds-check.c index c052f66e..c173d285 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -4782,6 +4782,7 @@ static int check_file_extent(struct btrfs_root *root, struct btrfs_key *fkey, extent_num_bytes, item_inline_len); err |= FILE_EXTENT_ERROR; } + *end += extent_num_bytes; *size += extent_num_bytes; return err; }