From patchwork Sun Nov 6 10:23:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9413903 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 F25F66022E for ; Sun, 6 Nov 2016 10:23:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEF6128505 for ; Sun, 6 Nov 2016 10:23:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D26B728E7E; Sun, 6 Nov 2016 10:23:51 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 5ED1428505 for ; Sun, 6 Nov 2016 10:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751636AbcKFKXv (ORCPT ); Sun, 6 Nov 2016 05:23:51 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33196 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751530AbcKFKXu (ORCPT ); Sun, 6 Nov 2016 05:23:50 -0500 Received: by mail-wm0-f68.google.com with SMTP id u144so11254168wmu.0; Sun, 06 Nov 2016 02:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AkJTo/g+3zqMAzd/PutgEuEyGm7zou59wc2sEkLJaCY=; b=AiMzrKCOdi9Px2YYslRkGQNuaRVpOHJlOoVVPikgVH5zAI3xZpBCosavrH+GsiHeYG DQVi6f9tKsDMmKKQxXqe+XS0xz+E6dtVn+or1AzIvZc5uKJoIHTOvciK0FklTqxu8/Ja doscL01cmPe/HaM4rW0vZWv5oPUd8KV5bdiw42YFwbWzzPRNaCS5nQLYjNq5DlwOkn0n TOPYFN2qft9MRgG7w5y0UQZbmwf459yVFOyuGs/aln1XyvGxFkFUhsD34a1p38/5HwiU 5ZRIBlDuKpqLFqV5jHLFu2/drUZt1SrFfF7JSXn47MevTwdHTOb71Yn3xneWhwdICODg 8ofg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AkJTo/g+3zqMAzd/PutgEuEyGm7zou59wc2sEkLJaCY=; b=Ytp70za9hpyyhYlIZtkx967sNMylSn+vpksOFPlLvbkklmO3LucxJJK0jLQ6nz3K3s RRXnIDcXYGCorioTD1TI5qTHgNuDI4gmglaw4K+dgXnNgT3x0qeJcWtW/l4SDKNE7Ma9 B3Tz+0P0++KqxZaGQ57UwsJ+JAAeRiUOnnTFUmaVDc4WwtryV7QnG3Vcu3cQyPWZ6dAM yOjFjfntcdCTdJnD7VpQe2OK57mX9HKf1oSoNuCq+cYXK5JiWbPPFxcK7L1wI8H9Hs4B RbACaLVm6Zfb97MIG95nHe6zMCt+Y1pjuT3KQrnUDyj3UDVMIPcdWmE1Ht2Jm1Mj7Dc5 abxQ== X-Gm-Message-State: ABUngvcc+81uKKFuRm6MsZwm+q9Pd1zNS/rZywabOV+BGPRtQrmMrAnFfKuPCvHTF7N1BQ== X-Received: by 10.28.172.6 with SMTP id v6mr4266223wme.36.1478427828430; Sun, 06 Nov 2016 02:23:48 -0800 (PST) Received: from amir-VirtualBox.ctera.local (bzq-82-81-193-202.cablep.bezeqint.net. [82.81.193.202]) by smtp.gmail.com with ESMTPSA id wn5sm24303421wjb.42.2016.11.06.02.23.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 06 Nov 2016 02:23:47 -0800 (PST) From: Amir Goldstein To: Theodore Ts'o Cc: Miklos Szeredi , "Darrick J . Wong" , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 2/2] test-appliance: add support for overlayfs over xfs Date: Sun, 6 Nov 2016 12:23:17 +0200 Message-Id: <1478427797-8969-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478427797-8969-1-git-send-email-amir73il@gmail.com> References: <1478427797-8969-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When PRIMARY_FSTYPE is set to xfs, format overlayfs underlying device as xfs with reflink support, because clone-up is so much nicer then copy-up. This requires using the for-next (for 4.9) branch of xfsprogs. Signed-off-by: Amir Goldstein --- .../test-appliance/files/root/fs/overlay/config | 44 ++++++++++++++++++---- kvm-xfstests/util/parse_cli | 2 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/kvm-xfstests/test-appliance/files/root/fs/overlay/config b/kvm-xfstests/test-appliance/files/root/fs/overlay/config index 4420cfe..63ae06f 100644 --- a/kvm-xfstests/test-appliance/files/root/fs/overlay/config +++ b/kvm-xfstests/test-appliance/files/root/fs/overlay/config @@ -4,18 +4,32 @@ DEFAULT_MKFS_OPTIONS="" +function __fsck() +{ + local dev="$1" + + case "$FSTESTTYP" in + ext4) + /sbin/e2fsck -fy "$dev" + ;; + xfs) + xfs_repair "$dev" + ;; + esac +} + function check_filesystem() { umount $SM_TST_DEV >& /dev/null - /sbin/e2fsck -fy "$SM_TST_DEV" + __fsck "$SM_TST_DEV" ret="$?" - mount -t ext4 $SM_TST_DEV $SM_TST_MNT + mount -t $FSTESTTYP $SM_TST_DEV $SM_TST_MNT echo e2fsck exited with status "$ret" umount $SM_SCR_DEV >& /dev/null - /sbin/e2fsck -fy "$SM_SCR_DEV" + __fsck "$SM_SCR_DEV" ret2="$?" - mount -t ext4 $SM_SCR_DEV $SM_SCR_MNT + mount -t $FSTESTTYP $SM_SCR_DEV $SM_SCR_MNT echo e2fsck exited with status "$ret2" if test "$ret" -eq 0 ; then @@ -24,16 +38,30 @@ function check_filesystem() return "$ret" } +function __mkfs() +{ + local dev="$1" + + case "$FSTESTTYP" in + ext4) + /sbin/mke2fs -F -q -t ext4 "$dev" + ;; + xfs) + mkfs.xfs -f -m rmapbt=1,reflink=1 "$dev" + ;; + esac +} + function format_filesystem() { umount $SM_TST_DEV >& /dev/null - /sbin/mke2fs -F -q -t ext4 $SM_TST_DEV - mount -t ext4 $SM_TST_DEV $SM_TST_MNT + __mkfs $SM_TST_DEV + mount -t $FSTESTTYP $SM_TST_DEV $SM_TST_MNT mkdir -p $SM_TST_MNT/ovl $SM_TST_MNT/testarea umount $SM_SCR_DEV >& /dev/null - /sbin/mke2fs -F -q -t ext4 $SM_SCR_DEV - mount -t ext4 $SM_SCR_DEV $SM_SCR_MNT + __mkfs $SM_SCR_DEV + mount -t $FSTESTTYP $SM_SCR_DEV $SM_SCR_MNT mkdir -p $SM_SCR_MNT/ovl $SM_SCR_MNT/testarea return 0 diff --git a/kvm-xfstests/util/parse_cli b/kvm-xfstests/util/parse_cli index a170931..ea747be 100644 --- a/kvm-xfstests/util/parse_cli +++ b/kvm-xfstests/util/parse_cli @@ -59,7 +59,7 @@ print_help () validate_test_name() { case "$1" in - btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*) ;; + btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*|overlay*) ;; *) echo -e "Invalid test name: $1\n" print_help