summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2017-03-20 23:08:53 +0000
committerPatrick Mooney <pmooney@pfmooney.com>2017-04-07 20:31:57 +0000
commita4558c5bba1300222deac334fc85028cb1d4a911 (patch)
tree438dfe46455bd0443ee8db5ebc95399451f03806
parent3bec90a705e84f930818a783c3c4b0382f7420ab (diff)
downloadillumos-joyent-a4558c5bba1300222deac334fc85028cb1d4a911.tar.gz
OS-6017 lxbrand aio emits wrong error in some cases
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r--usr/src/lib/brand/lx/testing/ltp_skiplist5
-rw-r--r--usr/src/uts/common/brand/lx/syscall/lx_aio.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/usr/src/lib/brand/lx/testing/ltp_skiplist b/usr/src/lib/brand/lx/testing/ltp_skiplist
index 35cd90f021..87d8b30187 100644
--- a/usr/src/lib/brand/lx/testing/ltp_skiplist
+++ b/usr/src/lib/brand/lx/testing/ltp_skiplist
@@ -175,11 +175,6 @@ ioctl03
ioctl04
ioctl05
ioctl06
-io_cancel01
-io_destroy01
-io_getevents01
-io_setup01
-io_submit01
keyctl01
kcmp01
kcmp02
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_aio.c b/usr/src/uts/common/brand/lx/syscall/lx_aio.c
index ab796bba16..44313ebb75 100644
--- a/usr/src/uts/common/brand/lx/syscall/lx_aio.c
+++ b/usr/src/uts/common/brand/lx/syscall/lx_aio.c
@@ -871,7 +871,7 @@ lx_io_submit(lx_aio_context_t cid, const long nr, uintptr_t **bpp)
/* Validate fd */
if ((fp = getf(cb.lxiocb_fd)) == NULL) {
- err = EINVAL;
+ err = EBADF;
break;
}
@@ -1156,6 +1156,16 @@ lx_io_cancel(lx_aio_context_t cid, lx_iocb_t *iocbp, lx_io_event_t *result)
lx_io_ctx_t *cp;
lx_io_elem_t *ep;
lx_io_event_t ev;
+ uint32_t buf;
+
+ /*
+ * The Linux io_cancel copies in a field from the iocb in order to
+ * locate the matching kernel-internal structure. To appease the LTP
+ * test case which exercises this, a similar copy is performed here.
+ */
+ if (copyin(iocbp, &buf, sizeof (buf)) != 0) {
+ return (set_errno(EFAULT));
+ }
if ((cp = lx_io_cp_hold(cid)) == NULL)
return (set_errno(EINVAL));