From patchwork Sat Sep 21 22:02:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Whitney X-Patchwork-Id: 276915 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 04B7C2C019E for ; Sun, 22 Sep 2013 08:02:52 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751567Ab3IUWCv (ORCPT ); Sat, 21 Sep 2013 18:02:51 -0400 Received: from mail-qc0-f180.google.com ([209.85.216.180]:62902 "EHLO mail-qc0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751269Ab3IUWCv (ORCPT ); Sat, 21 Sep 2013 18:02:51 -0400 Received: by mail-qc0-f180.google.com with SMTP id p19so1148568qcv.11 for ; Sat, 21 Sep 2013 15:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=K6WnhB8GNOWw1HnMohFyPc3uifnPlujgRCjt/Q3Dpw8=; b=ve+PATlzGgFa37uPG5gY/fyJ2SyfDRIdkSJzeTKmmZRhmJxoWYohPWmHerUG0gKaNh 1cj0JR+3DiuoXHa4jIRvVAzpQ4CMxK1tn+Ek/wiR01LRi3wr0EpYEzlv3aW/tJYOPbpY EhmuZSV732JsEvrYnhdLtA3GFdkM9ilYKJ3LcVN+7njDOqcL8ZQwbMAX3potwEQZP+4K Cw6PelwqslnRu0OG7Cg9ti8gTMwhoAahbsQvP/Lro0hNV63dQ+VKWhiEN3oVIerSTO3K AZXYV4ncxtbSbac4lhNWWRaiLEboZpLx/pHnFdY1O/o9hlzt6YpCzlqXuprzC5T990xV EUeg== X-Received: by 10.49.39.161 with SMTP id q1mr12901316qek.66.1379800970618; Sat, 21 Sep 2013 15:02:50 -0700 (PDT) Received: from wallace (c-75-68-62-236.hsd1.nh.comcast.net. [75.68.62.236]) by mx.google.com with ESMTPSA id a2sm30018671qek.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 21 Sep 2013 15:02:50 -0700 (PDT) Date: Sat, 21 Sep 2013 18:02:47 -0400 From: Eric Whitney To: xfs@oss.sgi.com Cc: linux-ext4@vger.kernel.org Subject: [PATCH V2] xfstests: only run generic/300 on filesystems supporting fallocate() Message-ID: <20130921220247.GE7855@wallace> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Generic/300 fails when run on a test filesystem that does not support fallocate(), as in the case of an ext4 filesystem created without the extent feature or with the bigalloc feature. It uses fio's falloc ioengine to generate part of its I/O load, and both fallocates blocks and punches holes. Verify that the test filesystem supports fallocate() before proceeding with the test, checking for both block allocation and hole punching capabilities. We need to use both _require_xfs_io_falloc and _require_xfs_io_falloc_punch because the latter does not currently test for block allocation support. Also, delete any pre-existing test output to avoid confusion with old results. Signed-off-by: Eric Whitney --- tests/generic/300 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/generic/300 b/tests/generic/300 index 7c60728..1bb2837 100755 --- a/tests/generic/300 +++ b/tests/generic/300 @@ -44,6 +44,17 @@ _supported_os Linux _need_to_be_root _require_scratch +# For this test, the test system's glibc and kernel and the test file system +# must support both fallocating and hole punching. We don't need xfs_io to +# perform the test, but we can use it to verify these preconditions. For now, +# this allows us to avoid duplicating the following functions for fio or other +# applications that might be used to generate I/O at the cost of picking up a +# minor dependency on xfsprogs. +_require_xfs_io_falloc +_require_xfs_io_falloc_punch + +rm -f $seqres.full + NUM_JOBS=$((4*LOAD_FACTOR)) BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` if [ $((BLK_DEV_SIZE)) -gt 1048576 ]