From patchwork Wed Jun 1 01:51:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9145881 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 3191760777 for ; Wed, 1 Jun 2016 01:51:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A3E123749 for ; Wed, 1 Jun 2016 01:51:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D82D26240; Wed, 1 Jun 2016 01:51:37 +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 B3D0023749 for ; Wed, 1 Jun 2016 01:51:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752711AbcFABvd (ORCPT ); Tue, 31 May 2016 21:51:33 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:45125 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750750AbcFABvc (ORCPT ); Tue, 31 May 2016 21:51:32 -0400 X-IronPort-AV: E=Sophos;i="5.20,367,1444665600"; d="scan'208";a="579228" Received: from unknown (HELO cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 01 Jun 2016 09:51:27 +0800 Received: from adam-work.localdomain (unknown [10.167.226.34]) by cn.fujitsu.com (Postfix) with ESMTP id 270424056403; Wed, 1 Jun 2016 09:51:22 +0800 (CST) From: Qu Wenruo To: dsterba@suse.com, linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: convert-tests: Add test for backup superblock migration Date: Wed, 1 Jun 2016 09:51:21 +0800 Message-Id: <20160601015121.23944-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.8.3 MIME-Version: 1.0 X-yoursite-MailScanner-ID: 270424056403.A90BA 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 New convert framework uses new and simpler chunk layout, while the cost is the more complex superblock range migration logical, compared to old convert. Enhance the convert test script to create file which will takes up 2nd backup superblock space, to ensure the superblock migration is working as expected. Suggested-by: David Sterba Signed-off-by: Qu Wenruo --- tests/convert-tests.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/convert-tests.sh b/tests/convert-tests.sh index 06d8419..d4e13d6 100755 --- a/tests/convert-tests.sh +++ b/tests/convert-tests.sh @@ -124,6 +124,12 @@ convert_test() { # create a file to check btrfs-convert can convert regular file # correct run_check_mount_test_dev + + # create a file inside the fs before convert, to make sure there is + # data covering btrfs backup superblock range (64M) + run_check $SUDO_HELPER dd if=/dev/zero bs=1M count=64 \ + of=$TEST_MNT/convert_space_holder + populate_fs run_check $SUDO_HELPER dd if=/dev/zero of=$TEST_MNT/test bs=$nodesize \ count=1 >/dev/null 2>&1