From patchwork Fri May 31 15:45:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 247977 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 179662C009E for ; Sat, 1 Jun 2013 01:45:49 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756429Ab3EaPpj (ORCPT ); Fri, 31 May 2013 11:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51699 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756699Ab3EaPpd (ORCPT ); Fri, 31 May 2013 11:45:33 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4VFjWJ6006386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 31 May 2013 11:45:32 -0400 Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4VFjVCL007310 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 31 May 2013 11:45:32 -0400 Message-ID: <51A8C59B.3030308@redhat.com> Date: Fri, 31 May 2013 10:45:31 -0500 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: xfs-oss , ext4 development Subject: [PATCH] xfstests: fix seek_sanity_test for fs w/o fallocate X-Enigmail-Version: 1.5.1 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org currently the seek_sanity_test (generic/285) fails on ext3 or ext2 due to fallocate() failures. Just ignore that test if the fs doesn't support fallocate. Signed-off-by: Eric Sandeen --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c index cd3b1ee..fbf5a8c 100644 --- a/src/seek_sanity_test.c +++ b/src/seek_sanity_test.c @@ -96,9 +96,13 @@ static int do_fallocate(int fd, off_t offset, off_t length, int mode) int ret; ret = fallocate(fd, mode, offset, length); - if (ret) + if (ret) { + /* Don't warn about a filesystem w/o fallocate support */ + if (errno == EOPNOTSUPP) + return ret; fprintf(stderr, " ERROR %d: Failed to preallocate " "space to %ld bytes\n", errno, (long) length); + } return ret; } @@ -290,8 +294,14 @@ static int test09(int fd, int testnum) /* preallocate 8M space to file */ ret = do_fallocate(fd, 0, filsz, 0); - if (ret < 0) + if (ret < 0) { + /* Report success if fs doesn't support fallocate */ + if (errno == EOPNOTSUPP) { + fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n"); + ret = 0; + } goto out; + } ret = do_pwrite(fd, buf, bufsz, bufsz * 10); if (!ret) { @@ -336,8 +346,14 @@ static int test08(int fd, int testnum) /* preallocate 4M space to file */ ret = do_fallocate(fd, 0, filsz, 0); - if (ret < 0) + if (ret < 0) { + /* Report success if fs doesn't support fallocate */ + if (errno == EOPNOTSUPP) { + fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n"); + ret = 0; + } goto out; + } ret = do_pwrite(fd, buf, bufsz, bufsz * 10); if (ret) @@ -379,8 +395,14 @@ static int test07(int fd, int testnum) /* preallocate 4M space to file */ ret = do_fallocate(fd, 0, filsz, 0); - if (ret < 0) + if (ret < 0) { + /* Report success if fs doesn't support fallocate */ + if (errno == EOPNOTSUPP) { + fprintf(stdout, "Test skipped as fs doesn't support fallocate.\n"); + ret = 0; + } goto out; + } ret = do_pwrite(fd, buf, bufsz, bufsz * 10); if (ret)