From patchwork Mon Jan 23 09:13:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9531933 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 31CB4604A0 for ; Mon, 23 Jan 2017 09:15:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27371205FB for ; Mon, 23 Jan 2017 09:15:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C6672833A; Mon, 23 Jan 2017 09:15:24 +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 1D4C228342 for ; Mon, 23 Jan 2017 09:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750964AbdAWJPR (ORCPT ); Mon, 23 Jan 2017 04:15:17 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:18859 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750916AbdAWJPP (ORCPT ); Mon, 23 Jan 2017 04:15:15 -0500 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="15006286" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 23 Jan 2017 17:14:23 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 7B2F547B1514; Mon, 23 Jan 2017 17:14:20 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Jan 2017 17:14:24 +0800 From: Qu Wenruo To: CC: , , Subject: [PATCH 8/9] btrfs-progs: fsck-tests: Add new test case for partly written prealloc extent Date: Mon, 23 Jan 2017 17:13:58 +0800 Message-ID: <20170123091359.21390-10-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170123091359.21390-1-quwenruo@cn.fujitsu.com> References: <20170123091359.21390-1-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: 7B2F547B1514.ABC95 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 This is a bug found in lowmem mode, which reports false alert for partly written prealloc extent. Reported-by: Chris Murphy Signed-off-by: Qu Wenruo --- tests/fsck-tests/020-extent-ref-cases/test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/fsck-tests/020-extent-ref-cases/test.sh b/tests/fsck-tests/020-extent-ref-cases/test.sh index 5dc5e55d..91340671 100755 --- a/tests/fsck-tests/020-extent-ref-cases/test.sh +++ b/tests/fsck-tests/020-extent-ref-cases/test.sh @@ -18,6 +18,7 @@ source $TOP/tests/common check_prereq btrfs +check_global_prereq xfs_io for img in *.img *.raw.xz do @@ -28,3 +29,17 @@ do run_check $TOP/btrfs check "$image" rm -f "$image" done + +# Extra test case for partly written prealloc extents. +test_prealloc_written() +{ + run_check $SUDO_HELPER $TOP/mkfs.btrfs -f $TEST_DEV + + run_check_mount_test_dev + xfs_io -f -c "falloc 0 128k" -c "syncfs" $TEST_MNT/tmpfile + xfs_io -c "pwrite 0 64k" $TEST_MNT/tmpfile + + run_check_umount_test_dev + + run_check $TOP/btrfs check $TEST_DEV +}