[LTP] [PATCH] preadv02/pwritev02: fix EFAULT testcase on s390/x

Cyril Hrubis chrubis@suse.cz
Mon Apr 25 17:19:05 CEST 2016


Hi!
>  static struct iovec rd_iovec2[] = {
> +#if !defined(__s390__) && !defined(__s390x__)
>  	{buf, CHUNK},
> +#endif
>  	{(char *)-1, CHUNK},
>  };

What about splitting it as:

--- a/testcases/kernel/syscalls/preadv/preadv02.c
+++ b/testcases/kernel/syscalls/preadv/preadv02.c
@@ -58,6 +58,9 @@ static struct iovec rd_iovec1[] = {
 
 static struct iovec rd_iovec2[] = {
        {buf, CHUNK},
+};
+
+static struct iovec rd_iovec3[] = {
        {(char *)-1, CHUNK},
 };
 
@@ -71,7 +74,7 @@ static struct tcase {
        {&fd1, rd_iovec1, 1, 0, EINVAL},
        {&fd1, rd_iovec2, -1, 0, EINVAL},
        {&fd1, rd_iovec2, 1, -1, EINVAL},
-       {&fd1, rd_iovec2, 2, 0, EFAULT},
+       {&fd1, rd_iovec3, 1, 0, EFAULT},
        {&fd3, rd_iovec2, 1, 0, EBADF},
        {&fd2, rd_iovec2, 1, 0, EBADF},
        {&fd4, rd_iovec2, 1, 0, EISDIR},

instead of adding #ifdefs?

That should work fine as well. Or do you want to reatain the part that tests
that we get EFAULT for the second part of the iovec as well?

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list