test/read-write: skip too-big test on non-root
We can't reset the limits back afterwards without failing, so just
skip this test for a regular user.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/test/read-write.c b/test/read-write.c
index 7f33ad4..409827a 100644
--- a/test/read-write.c
+++ b/test/read-write.c
@@ -692,6 +692,11 @@
int i, fd, ret;
loff_t off;
+ if (geteuid()) {
+ fprintf(stdout, "Not root, skipping %s\n", __FUNCTION__);
+ return 0;
+ }
+
if (getrlimit(RLIMIT_FSIZE, &old_rlim) < 0) {
perror("getrlimit");
return 1;