lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 31 May 2013 10:45:31 -0500
From:	Eric Sandeen <sandeen@...hat.com>
To:	xfs-oss <xfs@....sgi.com>,
	ext4 development <linux-ext4@...r.kernel.org>
Subject: [PATCH] xfstests: fix seek_sanity_test for fs w/o fallocate

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 <sandeen@...hat.com>
---

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)

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ