diff mbox series

mremap06: fallocate is not supported on nfsv3

Message ID 20240326205657.3103176-1-samasth.norway.ananda@oracle.com
State Superseded
Headers show
Series mremap06: fallocate is not supported on nfsv3 | expand

Commit Message

Samasth Norway Ananda March 26, 2024, 8:56 p.m. UTC
The function fallocate() is not supported on nfsv3. Thus when we run the
mremap06 test over a nfsv3 filesystem the test fails.

Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
---
 testcases/kernel/syscalls/mremap/mremap06.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/mremap/mremap06.c b/testcases/kernel/syscalls/mremap/mremap06.c
index 3bbaf441a..362b03e19 100644
--- a/testcases/kernel/syscalls/mremap/mremap06.c
+++ b/testcases/kernel/syscalls/mremap/mremap06.c
@@ -104,8 +104,14 @@  static void setup(void)
 	fd = SAFE_OPEN("testfile", O_CREAT | O_RDWR | O_TRUNC, 0600);
 
 	ret = fallocate(fd, 0, 0, mmap_size);
-	if (ret == -1)
+	if (ret != 0) {
+		if (errno == EOPNOTSUPP || errno == ENOSYS) {
+			tst_brk(TCONF,
+				"fallocate system call is not implemented");
+		}
 		tst_brk(TBROK, "fallocate() failed");
+		return;
+	}
 
 	buf = SAFE_MMAP(0, mmap_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);