* [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
@ 2025-04-30 13:36 Cyril Hrubis
2025-04-30 14:41 ` Avinesh Kumar
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Cyril Hrubis @ 2025-04-30 13:36 UTC (permalink / raw)
To: ltp
There was a single case of "#ifndef CRAY" in all the "#ifdef CRAY"
macros that got removed accidentally. This patch restores that piece.
Fixes: fed3e3ee6399 ('lib/tlibio: Get rid of support for old UNIXes')
Reported-by: Avinesh Kumar <akumar@suse.de>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
lib/tlibio.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
diff --git a/lib/tlibio.c b/lib/tlibio.c
index 451244525..b3e723aa7 100644
--- a/lib/tlibio.c
+++ b/lib/tlibio.c
@@ -767,6 +767,34 @@ int lio_write_buffer(int fd, /* open file descriptor */
return -errno;
}
}
+ else if (method & LIO_IO_SYNCV) {
+ io_type = "writev(2)";
+
+ sprintf(Lio_SysCall, "writev(%d, &iov, 1) nbyte:%d", fd, size);
+
+ if (Debug_level) {
+ printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
+ Lio_SysCall);
+ }
+ if ((ret = writev(fd, &iov, 1)) == -1) {
+ sprintf(Errormsg,
+ "%s/%d writev(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s",
+ __FILE__, __LINE__, fd, size, errno,
+ strerror(errno));
+ return -errno;
+ }
+
+ if (ret != size) {
+ sprintf(Errormsg,
+ "%s/%d writev(%d, iov, 1) nbyte:%d returned=%d",
+ __FILE__, __LINE__, fd, size, ret);
+ } else if (Debug_level > 1)
+ printf
+ ("DEBUG %s/%d: writev completed without error (ret %d)\n",
+ __FILE__, __LINE__, ret);
+
+ return ret;
+ } /* LIO_IO_SYNCV */
/* LIO_IO_ALISTIO */
else if (method & LIO_IO_SYNCP) {
io_type = "pwrite(2)";
@@ -1150,6 +1178,34 @@ int lio_read_buffer(int fd, /* open file descriptor */
}
}
/* LIO_IO_ALISTIO */
+ else if (method & LIO_IO_SYNCV) {
+ io_type = "readv(2)";
+
+ sprintf(Lio_SysCall, "readv(%d, &iov, 1) nbyte:%d", fd, size);
+
+ if (Debug_level) {
+ printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
+ Lio_SysCall);
+ }
+ if ((ret = readv(fd, &iov, 1)) == -1) {
+ sprintf(Errormsg,
+ "%s/%d readv(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s",
+ __FILE__, __LINE__, fd, size, errno,
+ strerror(errno));
+ return -errno;
+ }
+
+ if (ret != size) {
+ sprintf(Errormsg,
+ "%s/%d readv(%d, iov, 1) nbyte:%d returned=%d",
+ __FILE__, __LINE__, fd, size, ret);
+ } else if (Debug_level > 1)
+ printf
+ ("DEBUG %s/%d: readv completed without error (ret %d)\n",
+ __FILE__, __LINE__, ret);
+
+ return ret;
+ } /* LIO_IO_SYNCV */
else if (method & LIO_IO_SYNCP) {
io_type = "pread(2)";
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
2025-04-30 13:36 [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV Cyril Hrubis
@ 2025-04-30 14:41 ` Avinesh Kumar
2025-04-30 14:41 ` Petr Vorel
2025-04-30 14:48 ` Petr Vorel
2 siblings, 0 replies; 5+ messages in thread
From: Avinesh Kumar @ 2025-04-30 14:41 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
On Wednesday, April 30, 2025 3:36:15 PM CEST Cyril Hrubis wrote:
> There was a single case of "#ifndef CRAY" in all the "#ifdef CRAY"
> macros that got removed accidentally. This patch restores that piece.
>
> Fixes: fed3e3ee6399 ('lib/tlibio: Get rid of support for old UNIXes')
> Reported-by: Avinesh Kumar <akumar@suse.de>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Thank you Cyril!
Tested-by: Avinesh Kumar <akumar@suse.de>
> ---
> lib/tlibio.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 56 insertions(+), 1 deletion(-)
>
> diff --git a/lib/tlibio.c b/lib/tlibio.c
> index 451244525..b3e723aa7 100644
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -767,6 +767,34 @@ int lio_write_buffer(int fd, /* open file descriptor */
> return -errno;
> }
> }
> + else if (method & LIO_IO_SYNCV) {
> + io_type = "writev(2)";
> +
> + sprintf(Lio_SysCall, "writev(%d, &iov, 1) nbyte:%d", fd, size);
> +
> + if (Debug_level) {
> + printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
> + Lio_SysCall);
> + }
> + if ((ret = writev(fd, &iov, 1)) == -1) {
> + sprintf(Errormsg,
> + "%s/%d writev(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s",
> + __FILE__, __LINE__, fd, size, errno,
> + strerror(errno));
> + return -errno;
> + }
> +
> + if (ret != size) {
> + sprintf(Errormsg,
> + "%s/%d writev(%d, iov, 1) nbyte:%d returned=%d",
> + __FILE__, __LINE__, fd, size, ret);
> + } else if (Debug_level > 1)
> + printf
> + ("DEBUG %s/%d: writev completed without error (ret %d)\n",
> + __FILE__, __LINE__, ret);
> +
> + return ret;
> + } /* LIO_IO_SYNCV */
> /* LIO_IO_ALISTIO */
> else if (method & LIO_IO_SYNCP) {
> io_type = "pwrite(2)";
> @@ -1150,6 +1178,34 @@ int lio_read_buffer(int fd, /* open file descriptor */
> }
> }
> /* LIO_IO_ALISTIO */
> + else if (method & LIO_IO_SYNCV) {
> + io_type = "readv(2)";
> +
> + sprintf(Lio_SysCall, "readv(%d, &iov, 1) nbyte:%d", fd, size);
> +
> + if (Debug_level) {
> + printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
> + Lio_SysCall);
> + }
> + if ((ret = readv(fd, &iov, 1)) == -1) {
> + sprintf(Errormsg,
> + "%s/%d readv(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s",
> + __FILE__, __LINE__, fd, size, errno,
> + strerror(errno));
> + return -errno;
> + }
> +
> + if (ret != size) {
> + sprintf(Errormsg,
> + "%s/%d readv(%d, iov, 1) nbyte:%d returned=%d",
> + __FILE__, __LINE__, fd, size, ret);
> + } else if (Debug_level > 1)
> + printf
> + ("DEBUG %s/%d: readv completed without error (ret %d)\n",
> + __FILE__, __LINE__, ret);
> +
> + return ret;
> + } /* LIO_IO_SYNCV */
> else if (method & LIO_IO_SYNCP) {
> io_type = "pread(2)";
>
>
Regards,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
2025-04-30 13:36 [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV Cyril Hrubis
2025-04-30 14:41 ` Avinesh Kumar
@ 2025-04-30 14:41 ` Petr Vorel
2025-04-30 15:19 ` Petr Vorel
2025-04-30 14:48 ` Petr Vorel
2 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2025-04-30 14:41 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
> There was a single case of "#ifndef CRAY" in all the "#ifdef CRAY"
> macros that got removed accidentally. This patch restores that piece.
> Fixes: fed3e3ee6399 ('lib/tlibio: Get rid of support for old UNIXes')
> Reported-by: Avinesh Kumar <akumar@suse.de>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Thanks for a quick fix!
> ---
> lib/tlibio.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 56 insertions(+), 1 deletion(-)
> diff --git a/lib/tlibio.c b/lib/tlibio.c
> index 451244525..b3e723aa7 100644
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -767,6 +767,34 @@ int lio_write_buffer(int fd, /* open file descriptor */
> return -errno;
> }
> }
> + else if (method & LIO_IO_SYNCV) {
> + io_type = "writev(2)";
> +
> + sprintf(Lio_SysCall, "writev(%d, &iov, 1) nbyte:%d", fd, size);
> +
> + if (Debug_level) {
> + printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__,
> + Lio_SysCall);
> + }
> + if ((ret = writev(fd, &iov, 1)) == -1) {
> + sprintf(Errormsg,
> + "%s/%d writev(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s",
> + __FILE__, __LINE__, fd, size, errno,
> + strerror(errno));
> + return -errno;
> + }
> +
> + if (ret != size) {
> + sprintf(Errormsg,
> + "%s/%d writev(%d, iov, 1) nbyte:%d returned=%d",
> + __FILE__, __LINE__, fd, size, ret);
> + } else if (Debug_level > 1)
> + printf
> + ("DEBUG %s/%d: writev completed without error (ret %d)\n",
> + __FILE__, __LINE__, ret);
> +
> + return ret;
> + } /* LIO_IO_SYNCV */
> /* LIO_IO_ALISTIO */
> else if (method & LIO_IO_SYNCP) {
> io_type = "pwrite(2)";
> @@ -1150,6 +1178,34 @@ int lio_read_buffer(int fd, /* open file descriptor */
> }
> }
> /* LIO_IO_ALISTIO */
> + else if (method & LIO_IO_SYNCV) {
nit: FYI LIO_IO_ALISTIO was originally on a slightly different place.
Kind regards,
Petr
diff --git lib/tlibio.c lib/tlibio.c
index d6765f8c48..b877393df2 100644
--- lib/tlibio.c
+++ lib/tlibio.c
@@ -767,6 +767,7 @@ int lio_write_buffer(int fd, /* open file descriptor */
return -errno;
}
}
+ /* LIO_IO_ALISTIO */
else if (method & LIO_IO_SYNCV) {
io_type = "writev(2)";
@@ -795,7 +796,6 @@ int lio_write_buffer(int fd, /* open file descriptor */
return ret;
} /* LIO_IO_SYNCV */
- /* LIO_IO_ALISTIO */
else if (method & LIO_IO_SYNCP) {
io_type = "pwrite(2)";
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
2025-04-30 13:36 [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV Cyril Hrubis
2025-04-30 14:41 ` Avinesh Kumar
2025-04-30 14:41 ` Petr Vorel
@ 2025-04-30 14:48 ` Petr Vorel
2 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2025-04-30 14:48 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
Hi Cyril,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV
2025-04-30 14:41 ` Petr Vorel
@ 2025-04-30 15:19 ` Petr Vorel
0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2025-04-30 15:19 UTC (permalink / raw)
To: Cyril Hrubis, ltp
Hi Cyril,
> Hi Cyril,
> > /* LIO_IO_ALISTIO */
> > + else if (method & LIO_IO_SYNCV) {
> nit: FYI LIO_IO_ALISTIO was originally on a slightly different place.
I dared to merge your fix.
I'm sorry, I was wrong, therefore merged your original patch.
Thanks a lot!
Kind regards,
Petr
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-04-30 15:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 13:36 [LTP] [PATCH] lib: tlibio.c: Restore LIO_IO_SYNCV Cyril Hrubis
2025-04-30 14:41 ` Avinesh Kumar
2025-04-30 14:41 ` Petr Vorel
2025-04-30 15:19 ` Petr Vorel
2025-04-30 14:48 ` Petr Vorel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.