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: 9461817 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 47AE760231 for ; Tue, 6 Dec 2016 01:02:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B33282E2 for ; Tue, 6 Dec 2016 01:02:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B61E2831B; Tue, 6 Dec 2016 01:02:08 +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=unavailable 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 E386F28319 for ; Tue, 6 Dec 2016 01:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752820AbcLFBBv (ORCPT ); Mon, 5 Dec 2016 20:01:51 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:33946 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373AbcLFBBr (ORCPT ); Mon, 5 Dec 2016 20:01:47 -0500 Received: by mail-pg0-f54.google.com with SMTP id x23so142523766pgx.1 for ; Mon, 05 Dec 2016 17:01:46 -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=jVo/KD6jbKyfqbVLjWJU30EovMVDiZN8GMqx8JBoWBZEwmDQASJ31roKbiOgExDpI2 VUsOWJZg4Md75Gl8b7d5mhjYjPA4XX8dDtn/hz1lbBxh/VnUUw4eQLsQZMBTd12z5fUF XJNVqlIWrjv0n816q7Nu2840r06mtUFQpfOx6LnztvmHyKDCRXqD4/+eDblsVq7BhaGQ lYtjGWNijyXRNTOkUdIGq1a0H/Sx7L8+kCuE+9o6uriN2n0xHbCahEQgDHcG7d1oIIQd 67hMt5eYEaQbx10Due5i8Wt1RjDCiEWAEOEPLOqW95tn1Ng5giOsPaUugT7/h03EezKA qdjw== X-Gm-Message-State: AKaTC02dt3+ZYxZp6+GrukU9uG8mblu1TDdtt8pbATuJCZqKYZ9gyPoJvuc80o0+q2G5TzEF 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: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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