From patchwork Tue Dec 6 01:01:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9461815 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 B41EF60231 for ; Tue, 6 Dec 2016 01:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A48DE282E2 for ; Tue, 6 Dec 2016 01:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98CA228324; Tue, 6 Dec 2016 01:02:07 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 C2E6C282E2 for ; Tue, 6 Dec 2016 01:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752479AbcLFBBu (ORCPT ); Mon, 5 Dec 2016 20:01:50 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36815 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751411AbcLFBBr (ORCPT ); Mon, 5 Dec 2016 20:01:47 -0500 Received: by mail-pf0-f180.google.com with SMTP id 189so66647833pfz.3 for ; Mon, 05 Dec 2016 17:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=JfdWWlhK22WTziFr0fG1MlOrqJRn8ujJ0qGM6KXB0Gw=; b=m3LgAsdTMcr+0+RhW/7t5LOK0IKe87Axz2uDlMXRJtLhqkvOh8p57kRtQD/hcNSH+T ntYWZOaJOa9sfYet4O1w92LW72WT3lsuZQtTG7F8a920HaBZvtu0RxIPkfeMdAjR6znp 47Y/9wuZNc67/pwpOhQu8BPXhrtuSL24FKMW4cTOeYBhNV0cKQIxgx/T6jjfzaed5wKq SueWiCT0+EnCo8v3lKqBzMYK99oUzK3Sx1GP1Vsyl0gGUNbVLqd9xa5KksyGNRzhVwQa NFGNkQzasS16KemDTpUAJDDt2y1lZO3ehNp/6eLeunbeXQzIKXPInYUwPR1RUJlISZHV mfdw== 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; bh=JfdWWlhK22WTziFr0fG1MlOrqJRn8ujJ0qGM6KXB0Gw=; b=JkkCjsXiB3atDqJcMg7bZySToHlcs01fFsI4kzH178KgVWIQXSZ/N5wL+b7k9gap0o 6k97dFdiN11EQ2whIuqFlF7ut5SU4Pt8flsns7GCAMGDP2gWcquT8NP0JqvTK51XBHlt CcfixwHLRtHNS56ZxXrIeCk44GN//ev0q/58W+in2+wSvephFPFqkUfs1gZ95Q54Er0G jOfSV6DT4RyIQLE8pVeAFSoCrlN+sYZMmfbcQSMIkQUEukicggXJn65F493Qr6w3MtHk 3AS+oR0/dn7bDuskXILDd1M6ymGMeMZ9m8Ai6i+gxdF4Q0p+1LADlaWibT2S2oammNlp 2kDw== X-Gm-Message-State: AKaTC00P4O3h9BG4OVl4mULIJrMor5uov4pwa/9wkcepIouYBnFlkWTTLRzccGdaAdGl9HTk X-Received: by 10.84.216.25 with SMTP id m25mr131000370pli.117.1480986106406; Mon, 05 Dec 2016 17:01:46 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:200::9:93a9]) by smtp.gmail.com with ESMTPSA id t25sm30203820pgo.9.2016.12.05.17.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 17:01:45 -0800 (PST) From: Omar Sandoval To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH] generic/35[67]: disable swapfile tests on Btrfs Date: Mon, 5 Dec 2016 17:01:28 -0800 Message-Id: X-Mailer: git-send-email 2.10.2 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval Btrfs doesn't support swapfiles (yet?), so generic/356 fails erroneously, and generic/357 only passes by accident. Let's add a _require_scratch_swapfile helper and add it to these tests. Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong --- I have some code enabling swapfiles for Btrfs [1], but there's some ABBA deadlock issues with i_rwsem and mmap_sem on swap-over-NFS that I haven't had time to sort out. In the meantime, let's just skip these tests. 1: https://github.com/osandov/linux/tree/btrfs-swap common/rc | 22 ++++++++++++++++++++++ tests/generic/356 | 1 + tests/generic/357 | 1 + 3 files changed, 24 insertions(+) diff --git a/common/rc b/common/rc index 2719b23..d863e56 100644 --- a/common/rc +++ b/common/rc @@ -1790,6 +1790,28 @@ _require_odirect() rm -f $testfile 2>&1 > /dev/null } +# Check that the filesystem supports swapfiles +_require_scratch_swapfile() +{ + _require_scratch + + _scratch_mkfs >/dev/null + _scratch_mount + + # Minimum size for mkswap is 10 pages + local size=$(($(get_page_size) * 10)) + + _pwrite_byte 0x61 0 "$size" "$SCRATCH_MNT/swap" >/dev/null 2>&1 + mkswap "$SCRATCH_MNT/swap" >/dev/null 2>&1 + if ! swapon "$SCRATCH_MNT/swap" >/dev/null 2>&1; then + _scratch_unmount + _notrun "swapfiles are not supported" + fi + + swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1 + _scratch_unmount +} + # Check that a fs has enough free space (in 1024b blocks) # _require_fs_space() diff --git a/tests/generic/356 b/tests/generic/356 index 6bb90c0..51eeb65 100755 --- a/tests/generic/356 +++ b/tests/generic/356 @@ -44,6 +44,7 @@ _cleanup() # real QA test starts here _supported_os Linux +_require_scratch_swapfile _require_scratch_reflink _require_cp_reflink diff --git a/tests/generic/357 b/tests/generic/357 index 439b314..0dd0c10 100755 --- a/tests/generic/357 +++ b/tests/generic/357 @@ -44,6 +44,7 @@ _cleanup() # real QA test starts here _supported_os Linux +_require_scratch_swapfile _require_scratch_reflink _require_cp_reflink