All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/preadv203: Add basic RWF_NOWAIT test
Date: Thu, 7 Feb 2019 12:47:17 +0100	[thread overview]
Message-ID: <20190207114717.GA9428@dell5510> (raw)
In-Reply-To: <20190206120724.GB13516@rei>

Hi Cyril,

> > I wonder if we want either warn user or run it both via (g)libc wrapper and
> > directly the syscall.

> I guess that we may drop a hint in the error message.

> > BTW testing on kernel 4.20.0, glibc 2.28 with sys_preadv2() and still get TBROK
> > EOPNOTSUPP. I tried to test on ext[2-4], btrfs. I wonder what I'm missing.

> That's strange, are you sure that the test was calling the wrapper
> instead of the glibc call?
See diff below, but I guess it's what you meant :).

> This should really work unless the support in kernel has been disabled
> in distribution kernel for some reason. I was testing it on vanilla
> kernel where it worked as expected.
What config option is needed?

It does not work on both my machines (glibc 2.27 and 2.28) and it's working on
various VMs with these versions.


Kind regards,
Petr


+++ testcases/kernel/syscalls/preadv2/preadv203.c
@@ -95,6 +95,12 @@ static int verify_short_read(struct iovec *iov, size_t iov_cnt,
 	return 0;
 }
 
+ static ssize_t sys_preadv2(int fd, const struct iovec *iov, int iovcnt,
+                            off_t offset, int flags)
+ {
+ 	return syscall(SYS_preadv2, fd, iov, iovcnt, offset, offset>>32, flags);
+ }
+
 static void *nowait_reader(void *unused LTP_ATTRIBUTE_UNUSED)
 {
 	char buf1[CHUNK_SZ/2];
@@ -115,7 +121,7 @@ static void *nowait_reader(void *unused LTP_ATTRIBUTE_UNUSED)
 		off_t off = random() % ((CHUNKS - 2) * CHUNK_SZ);
 		int fd = fds[random() % FILES];
 
-		TEST(preadv2(fd, rd_iovec, 2, off, RWF_NOWAIT));
+		TEST(sys_preadv2(fd, rd_iovec, 2, off, RWF_NOWAIT));
 
 		if (TST_RET < 0) {
 			if (TST_ERR != EAGAIN)

  reply	other threads:[~2019-02-07 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-28 13:46 [PATCH] syscalls/preadv203: Add basic RWF_NOWAIT test Cyril Hrubis
2019-01-28 13:46 ` [LTP] " Cyril Hrubis
2019-02-06  7:52 ` Petr Vorel
2019-02-06 12:07   ` Cyril Hrubis
2019-02-07 11:47     ` Petr Vorel [this message]
2019-02-06  8:04 ` Petr Vorel
2019-02-06 12:10   ` Cyril Hrubis
2019-02-21 17:57     ` Naresh Kamboju
2019-02-06  8:36 ` Vijay Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190207114717.GA9428@dell5510 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.