From patchwork Mon Jun 27 07:50:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9199999 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 4FA4060757 for ; Mon, 27 Jun 2016 07:52:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42CEF281C3 for ; Mon, 27 Jun 2016 07:52:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37DCF28324; Mon, 27 Jun 2016 07:52:47 +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 DD7C6281C3 for ; Mon, 27 Jun 2016 07:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbcF0Hwl (ORCPT ); Mon, 27 Jun 2016 03:52:41 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:18089 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751830AbcF0Hwk (ORCPT ); Mon, 27 Jun 2016 03:52:40 -0400 X-IronPort-AV: E=Sophos;i="5.20,367,1444665600"; d="scan'208";a="646269" Received: from unknown (HELO cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 27 Jun 2016 15:52:19 +0800 Received: from localhost.localdomain (unknown [10.167.226.34]) by cn.fujitsu.com (Postfix) with ESMTP id EFADA4056406 for ; Mon, 27 Jun 2016 15:52:15 +0800 (CST) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/2] btrfs-progs: convert-test: Add test case for discontinuous hole extent Date: Mon, 27 Jun 2016 15:50:11 +0800 Message-Id: <20160627075011.24330-2-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160627075011.24330-1-quwenruo@cn.fujitsu.com> References: <20160627075011.24330-1-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: EFADA4056406.AE777 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 For ext* fs containing a large hole(larger than 128M), btrfs-convert will only insert one 128M hole extent and skip the remaining. This leads to discontinuous file extents. Add test case for it, and since it's a pinpoint regression test case, no combination of convert options nor checksum verification. Signed-off-by: Qu Wenruo --- tests/convert-tests/006-large-hole-extent/test.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tests/convert-tests/006-large-hole-extent/test.sh diff --git a/tests/convert-tests/006-large-hole-extent/test.sh b/tests/convert-tests/006-large-hole-extent/test.sh new file mode 100755 index 0000000..d3bc093 --- /dev/null +++ b/tests/convert-tests/006-large-hole-extent/test.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Create a base image with large hole extent, then convert to btrfs, +# check the converted image. +# Check if btrfs-convert can handle such large hole. +# Fast pinpoint regression test. No options combination nor checksum +# verification + +source $TOP/tests/common +source $TOP/tests/common.convert + +setup_root_helper +prepare_test_dev 512M +check_prereq btrfs-convert + +default_mke2fs="mke2fs -t ext4 -b 4096" +convert_test_preamble '' 'large hole extent test' 16k "$default_mke2fs" +convert_test_prep_fs $default_mke2fs + +run_check $SUDO_HELPER dd if=/dev/zero of=$TEST_MNT/file bs=1M \ + count=1 seek=1024 > /dev/null 2>&1 + +run_check_umount_test_dev +convert_test_do_convert