public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier
@ 2024-04-12  5:26 Samasth Norway Ananda via ltp
  2024-04-12  6:22 ` Petr Vorel
  2024-04-12  7:33 ` Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Samasth Norway Ananda via ltp @ 2024-04-12  5:26 UTC (permalink / raw)
  To: ltp; +Cc: calum.mackay

The function fallocate() is only supported over NFSv4.2. Thus when we
run the mremap06 ltp test over an NFSv4.1 or earlier filesystem the test
fails.

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

diff --git a/testcases/kernel/syscalls/mremap/mremap06.c b/testcases/kernel/syscalls/mremap/mremap06.c
index 3bbaf441a..f3df0551c 100644
--- a/testcases/kernel/syscalls/mremap/mremap06.c
+++ b/testcases/kernel/syscalls/mremap/mremap06.c
@@ -104,8 +104,13 @@ 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 (tst_fs_type(".") == TST_NFS_MAGIC && (errno == EOPNOTSUPP || errno == ENOSYS)) {
+			tst_brk(TCONF,
+				"fallocate system call is not implemented");
+		}
 		tst_brk(TBROK, "fallocate() failed");
+	}
 
 	buf = SAFE_MMAP(0, mmap_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
 
-- 
2.43.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier
  2024-04-12  5:26 [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier Samasth Norway Ananda via ltp
@ 2024-04-12  6:22 ` Petr Vorel
  2024-04-12  7:33 ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2024-04-12  6:22 UTC (permalink / raw)
  To: Samasth Norway Ananda; +Cc: calum.mackay, ltp

Hi all,

> The function fallocate() is only supported over NFSv4.2. Thus when we
> run the mremap06 ltp test over an NFSv4.1 or earlier filesystem the test
> fails.

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

> diff --git a/testcases/kernel/syscalls/mremap/mremap06.c b/testcases/kernel/syscalls/mremap/mremap06.c
> index 3bbaf441a..f3df0551c 100644
> --- a/testcases/kernel/syscalls/mremap/mremap06.c
> +++ b/testcases/kernel/syscalls/mremap/mremap06.c
> @@ -104,8 +104,13 @@ 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 (tst_fs_type(".") == TST_NFS_MAGIC && (errno == EOPNOTSUPP || errno == ENOSYS)) {
> +			tst_brk(TCONF,
> +				"fallocate system call is not implemented");
> +		}

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Thanks!

NOTE: I'll amend the code formatting before merge:

		if (tst_fs_type(".") == TST_NFS_MAGIC && (errno == EOPNOTSUPP ||
												  errno == ENOSYS)) {
			tst_brk(TCONF, "fallocate system call is not implemented");
		}

And prepare following patch which adds safe_fallocate() in the library.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier
  2024-04-12  5:26 [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier Samasth Norway Ananda via ltp
  2024-04-12  6:22 ` Petr Vorel
@ 2024-04-12  7:33 ` Cyril Hrubis
  2024-04-12  9:16   ` Petr Vorel
  1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2024-04-12  7:33 UTC (permalink / raw)
  To: Samasth Norway Ananda; +Cc: calum.mackay, ltp

Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier
  2024-04-12  7:33 ` Cyril Hrubis
@ 2024-04-12  9:16   ` Petr Vorel
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2024-04-12  9:16 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: calum.mackay, ltp

Hi Samasth, Cyril,

patch merged, thanks!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-12  9:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12  5:26 [LTP] [PATCH v2] mremap06: fallocate is not supported on nfsv4.1 or earlier Samasth Norway Ananda via ltp
2024-04-12  6:22 ` Petr Vorel
2024-04-12  7:33 ` Cyril Hrubis
2024-04-12  9:16   ` Petr Vorel

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