public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] src/seek_sanity_test: skip test20 if file's too big
@ 2018-08-27 13:12 Luis Henriques
  0 siblings, 0 replies; only message in thread
From: Luis Henriques @ 2018-08-27 13:12 UTC (permalink / raw)
  To: fstests; +Cc: Jan Kara, Luis Henriques

Since the allocation size can be quite big for some filesystems (4194304
for cephfs), the pwrite operation in test20 may fail with EFBIG.  Skip
this test if that's the case.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
---
 src/seek_sanity_test.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/seek_sanity_test.c b/src/seek_sanity_test.c
index e5aab239771d..e9938d1b1a23 100644
--- a/src/seek_sanity_test.c
+++ b/src/seek_sanity_test.c
@@ -280,8 +280,17 @@ static int test20(int fd, int testnum)
 	/* Magic size in the middle of ext[23] triple indirect tree */
 	filsz = (12 + bufsz / 4 + 8 * bufsz / 4 * bufsz / 4 + 2 * bufsz / 4 + 5) * bufsz;
 	ret = do_pwrite(fd, buf, bufsz, filsz - bufsz);
-	if (ret)
+	if (ret) {
+		/*
+		 * Report success. Filesystem just cannot handle so large
+		 * offsets and correctly reports it.
+		 */
+		if (errno == EFBIG) {
+			fprintf(stdout, "Test skipped as fs doesn't support so large files.\n");
+			ret = 0;
+		}
 		goto out;
+	}
 
 	/* Offset inside ext[23] indirect block */
 	ret += do_lseek(testnum, 1, fd, filsz, SEEK_DATA, 14 * bufsz, filsz - bufsz);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-27 16:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 13:12 [PATCH] src/seek_sanity_test: skip test20 if file's too big Luis Henriques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox