From patchwork Fri Jun 16 01:43:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9790441 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 DFB5E602CB for ; Fri, 16 Jun 2017 01:43:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6EDB27F86 for ; Fri, 16 Jun 2017 01:43:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B980428631; Fri, 16 Jun 2017 01:43:58 +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 3FD5F27F86 for ; Fri, 16 Jun 2017 01:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751774AbdFPBnl (ORCPT ); Thu, 15 Jun 2017 21:43:41 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:8454 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751578AbdFPBnl (ORCPT ); Thu, 15 Jun 2017 21:43:41 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20097160" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 16 Jun 2017 09:43:39 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 6DEB747C7C69; Fri, 16 Jun 2017 09:43:36 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 16 Jun 2017 09:43:33 +0800 From: Qu Wenruo To: CC: Subject: [PATCH 1/2] btrfs-progs: Fix false alert about EXTENT_DATA shouldn't be hole Date: Fri, 16 Jun 2017 09:43:22 +0800 Message-ID: <20170616014323.13170-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.13.1 MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: 6DEB747C7C69.A2CA9 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@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 Since incompat feature NO_HOLES still allow us to have explicit hole file extent, current check is too restrict and will cause false alert like: root 5 EXTENT_DATA[257, 0] shouldn't be hole Fix it by removing the restrict hole file extent check. Reported-by: Henk Slager Signed-off-by: Qu Wenruo Tested-by: Henk Slager --- cmds-check.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmds-check.c b/cmds-check.c index c052f66e..7bd57677 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -4841,11 +4841,7 @@ static int check_file_extent(struct btrfs_root *root, struct btrfs_key *fkey, } /* Check EXTENT_DATA hole */ - if (no_holes && is_hole) { - err |= FILE_EXTENT_ERROR; - error("root %llu EXTENT_DATA[%llu %llu] shouldn't be hole", - root->objectid, fkey->objectid, fkey->offset); - } else if (!no_holes && *end != fkey->offset) { + if (!no_holes && *end != fkey->offset) { err |= FILE_EXTENT_ERROR; error("root %llu EXTENT_DATA[%llu %llu] interrupt", root->objectid, fkey->objectid, fkey->offset);