summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-08-04 15:41:08 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-08-04 15:41:29 +0000
commita6312f35f39642af75b0535cbff3d4a583b37b9a (patch)
tree563dbc2f55bea5c0c55e4eabd3fc8565c47cc96f
parent481cd288917954faeea10791504479f6084d2602 (diff)
downloadillumos-joyent-a6312f35f39642af75b0535cbff3d4a583b37b9a.tar.gz
OS-4002 ionice requirements not met on lx ubuntu64 14.04.003
OS-4587 lx: ubuntu 15.04 - Failed at step IOPRIO spawning /bin/systemd-tmpfiles: Function not implemented
-rw-r--r--usr/src/lib/brand/lx/lx_brand/common/mount.c6
-rw-r--r--usr/src/uts/common/brand/lx/os/lx_syscall.c8
-rw-r--r--usr/src/uts/common/brand/lx/sys/lx_syscalls.h2
-rw-r--r--usr/src/uts/common/brand/lx/syscall/lx_ioprio.c66
-rw-r--r--usr/src/uts/intel/Makefile.files1
5 files changed, 76 insertions, 7 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/mount.c b/usr/src/lib/brand/lx/lx_brand/common/mount.c
index 25eb37851f..72c879d487 100644
--- a/usr/src/lib/brand/lx/lx_brand/common/mount.c
+++ b/usr/src/lib/brand/lx/lx_brand/common/mount.c
@@ -724,9 +724,9 @@ lx_mount(uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4,
}
/*
- * Linux seems to always allow overlay mounts, but some distros
- * attempt to mount tmpfs on /dev and we can't allow that. We
- * also don't overlay on anything under /dev.
+ * Linux seems to always allow overlay mounts. We allow this
+ * everywhere except under /dev where it interferes with device
+ * emulation.
*/
if (strcmp(targetp, "/dev") != 0 &&
strncmp(targetp, "/dev/", 5) != 0)
diff --git a/usr/src/uts/common/brand/lx/os/lx_syscall.c b/usr/src/uts/common/brand/lx/os/lx_syscall.c
index ad52900dba..b3ee62ef75 100644
--- a/usr/src/uts/common/brand/lx/os/lx_syscall.c
+++ b/usr/src/uts/common/brand/lx/os/lx_syscall.c
@@ -816,8 +816,8 @@ lx_sysent_t lx_sysent32[] = {
{"add_key", NULL, NOSYS_NULL, 0}, /* 286 */
{"request_key", NULL, NOSYS_NULL, 0}, /* 287 */
{"keyctl", NULL, NOSYS_NULL, 0}, /* 288 */
- {"ioprio_set", NULL, NOSYS_NULL, 0}, /* 289 */
- {"ioprio_get", NULL, NOSYS_NULL, 0}, /* 290 */
+ {"ioprio_set", lx_ioprio_set, 0, 3}, /* 289 */
+ {"ioprio_get", lx_ioprio_get, 0, 2}, /* 290 */
{"inotify_init", NULL, 0, 0}, /* 291 */
{"inotify_add_watch", NULL, 0, 3}, /* 292 */
{"inotify_rm_watch", NULL, 0, 2}, /* 293 */
@@ -1145,8 +1145,8 @@ lx_sysent_t lx_sysent64[] = {
{"add_key", NULL, NOSYS_NULL, 0}, /* 248 */
{"request_key", NULL, NOSYS_NULL, 0}, /* 249 */
{"keyctl", NULL, NOSYS_NULL, 0}, /* 250 */
- {"ioprio_set", NULL, NOSYS_NULL, 0}, /* 251 */
- {"ioprio_get", NULL, NOSYS_NULL, 0}, /* 252 */
+ {"ioprio_set", lx_ioprio_set, 0, 3}, /* 251 */
+ {"ioprio_get", lx_ioprio_get, 0, 2}, /* 252 */
{"inotify_init", NULL, 0, 0}, /* 253 */
{"inotify_add_watch", NULL, 0, 3}, /* 254 */
{"inotify_rm_watch", NULL, 0, 2}, /* 255 */
diff --git a/usr/src/uts/common/brand/lx/sys/lx_syscalls.h b/usr/src/uts/common/brand/lx/sys/lx_syscalls.h
index 3202bb5455..f0cbcedb8c 100644
--- a/usr/src/uts/common/brand/lx/sys/lx_syscalls.h
+++ b/usr/src/uts/common/brand/lx/sys/lx_syscalls.h
@@ -67,6 +67,8 @@ extern long lx_getrlimit();
extern long lx_gettid();
extern long lx_gettimeofday();
extern long lx_ioctl();
+extern long lx_ioprio_get();
+extern long lx_ioprio_set();
extern long lx_kill();
extern long lx_lchown();
extern long lx_lchown16();
diff --git a/usr/src/uts/common/brand/lx/syscall/lx_ioprio.c b/usr/src/uts/common/brand/lx/syscall/lx_ioprio.c
new file mode 100644
index 0000000000..13397e199e
--- /dev/null
+++ b/usr/src/uts/common/brand/lx/syscall/lx_ioprio.c
@@ -0,0 +1,66 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2015 Joyent, Inc.
+ */
+
+#include <sys/errno.h>
+#include <sys/systm.h>
+#include <sys/lx_brand.h>
+
+/* 'which' values. */
+#define LX_IOPRIO_WHO_PROCESS 1
+#define LX_IOPRIO_WHO_PGRP 2
+#define LX_IOPRIO_WHO_USER 3
+
+/*
+ * The possible values for the class. We report best effort (BE) as the class
+ * in use.
+ */
+#define LX_IOPRIO_CLASS_RT 1
+#define LX_IOPRIO_CLASS_BE 2
+#define LX_IOPRIO_CLASS_IDLE 3
+
+/* Macro to determine the class from the input mask */
+#define LX_IOPRIO_PRIO_CLASS(m) ((m) >> 13)
+
+/* ARGSUSED */
+long
+lx_ioprio_get(int which, int who)
+{
+ if (which < LX_IOPRIO_WHO_PROCESS || which > LX_IOPRIO_WHO_USER)
+ return (set_errno(EINVAL));
+
+ return (LX_IOPRIO_CLASS_BE);
+}
+
+/*
+ * We allow setting any valid class, even though it's ignored.
+ * We ignore the 'who' parameter which means that we're not searching for
+ * the specified target in order to return a specific errno in the case that
+ * the target does not exist.
+ */
+/* ARGSUSED */
+long
+lx_ioprio_set(int which, int who, int mask)
+{
+ int class;
+
+ if (which < LX_IOPRIO_WHO_PROCESS || which > LX_IOPRIO_WHO_USER)
+ return (set_errno(EINVAL));
+
+ class = LX_IOPRIO_PRIO_CLASS(mask);
+ if (class < LX_IOPRIO_CLASS_RT || class > LX_IOPRIO_CLASS_IDLE)
+ return (set_errno(EINVAL));
+
+ return (0);
+}
diff --git a/usr/src/uts/intel/Makefile.files b/usr/src/uts/intel/Makefile.files
index 78c9de19f2..3f25e2f6f5 100644
--- a/usr/src/uts/intel/Makefile.files
+++ b/usr/src/uts/intel/Makefile.files
@@ -302,6 +302,7 @@ LX_BRAND_OBJS = \
lx_getrandom.o \
lx_id.o \
lx_ioctl.o \
+ lx_ioprio.o \
lx_kill.o \
lx_misc.o \
lx_mkdir.o \