summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2019-09-03 14:16:11 +0000
committerJohn Levon <john.levon@joyent.com>2019-09-03 14:16:11 +0000
commit391bfda4cfa65547cb06c514c00f3b9b70864abc (patch)
tree2b0c17b408b7ab82874b03ca33581dcdadb05d4b
parent85cbce56b9ab1ce24ffeab318cb4c2b3ac67023c (diff)
downloadillumos-joyent-391bfda4cfa65547cb06c514c00f3b9b70864abc.tar.gz
OS-7978 ps in some lx zones no longer works
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Mike Gerdts <mike.gerdts@joyent.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Approved by: Patrick Mooney <patrick.mooney@joyent.com>
-rw-r--r--usr/src/uts/common/brand/lx/procfs/lx_proc.h13
-rw-r--r--usr/src/uts/common/brand/lx/procfs/lx_prvnops.c32
2 files changed, 34 insertions, 11 deletions
diff --git a/usr/src/uts/common/brand/lx/procfs/lx_proc.h b/usr/src/uts/common/brand/lx/procfs/lx_proc.h
index 619216f999..723dfff560 100644
--- a/usr/src/uts/common/brand/lx/procfs/lx_proc.h
+++ b/usr/src/uts/common/brand/lx/procfs/lx_proc.h
@@ -237,9 +237,12 @@ typedef enum lxpr_nodetype {
LXPR_SYS_NET_IPV4_ICMP_EIB, /* .../icmp_echo_ignore_broadcasts */
LXPR_SYS_NET_IPV4_IP_FORWARD, /* .../net/ipv4/ip_forward */
LXPR_SYS_NET_IPV4_IP_LPORT_RANGE, /* .../net/ipv4/ip_local_port_range */
- LXPR_SYS_NET_IPV4_TCP_CC_ALLOW, /* .../tcp_allowed_congestion_control */
- LXPR_SYS_NET_IPV4_TCP_CC_AVAIL, /* .../tcp_available_congestion_control */
- LXPR_SYS_NET_IPV4_TCP_CC_CURR, /* .../tcp_congestion_control */
+ /* .../tcp_allowed_congestion_control */
+ LXPR_SYS_NET_IPV4_TCP_CC_ALLOW,
+ /* .../tcp_available_congestion_control */
+ LXPR_SYS_NET_IPV4_TCP_CC_AVAIL,
+ /* .../tcp_congestion_control */
+ LXPR_SYS_NET_IPV4_TCP_CC_CURR,
LXPR_SYS_NET_IPV4_TCP_FIN_TO, /* /proc/sys/net/ipv4/tcp_fin_timeout */
LXPR_SYS_NET_IPV4_TCP_KA_INT, /* .../net/ipv4/tcp_keepalive_intvl */
LXPR_SYS_NET_IPV4_TCP_KA_TIM, /* .../net/ipv4/tcp_keepalive_time */
@@ -294,7 +297,7 @@ typedef struct {
* which is attached to v_data in the vnode structure
*/
typedef struct lxpr_node {
- lxpr_nodetype_t lxpr_type; /* type of this node */
+ lxpr_nodetype_t lxpr_type; /* type of this node */
vnode_t *lxpr_vnode; /* vnode for the node */
vnode_t *lxpr_parent; /* parent directory */
vnode_t *lxpr_realvp; /* real vnode, file in dirs */
@@ -304,7 +307,7 @@ typedef struct lxpr_node {
gid_t lxpr_gid; /* file group owner */
pid_t lxpr_pid; /* pid of proc referred to */
uint_t lxpr_desc; /* addl. descriptor (fd or tid) */
- ino_t lxpr_ino; /* node id */
+ ino_t lxpr_ino; /* node id */
} lxpr_node_t;
struct zone; /* forward declaration */
diff --git a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c
index 208b0acccf..bcfdd346da 100644
--- a/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c
+++ b/usr/src/uts/common/brand/lx/procfs/lx_prvnops.c
@@ -810,7 +810,7 @@ lxpr_close(vnode_t *vp, int flag, int count, offset_t offset, cred_t *cr,
return (0);
}
-static void (*lxpr_read_function[LXPR_NFILES])() = {
+static void (*lxpr_read_function[])() = {
NULL, /* invalid */
lxpr_read_isdir, /* /proc */
lxpr_read_isdir, /* /proc/<pid> */
@@ -941,9 +941,12 @@ static void (*lxpr_read_function[LXPR_NFILES])() = {
lxpr_read_sys_net_ipv4_icmp_eib, /* .../icmp_echo_ignore_broadcasts */
lxpr_read_sys_net_ipv4_ip_forward, /* .../ipv4/ip_forward */
lxpr_read_sys_net_ipv4_ip_lport_range, /* ../ipv4/ip_local_port_range */
- lxpr_read_sys_net_ipv4_tcp_cc_allow, /* .../tcp_allowed_congestion_control */
- lxpr_read_sys_net_ipv4_tcp_cc_avail, /* .../tcp_available_congestion_control */
- lxpr_read_sys_net_ipv4_tcp_cc_curr, /* .../tcp_congestion_control */
+ /* .../tcp_allowed_congestion_control */
+ lxpr_read_sys_net_ipv4_tcp_cc_allow,
+ /* .../tcp_available_congestion_control */
+ lxpr_read_sys_net_ipv4_tcp_cc_avail,
+ /* .../tcp_congestion_control */
+ lxpr_read_sys_net_ipv4_tcp_cc_curr,
lxpr_read_sys_net_ipv4_tcp_fin_to, /* .../ipv4/tcp_fin_timeout */
lxpr_read_sys_net_ipv4_tcp_ka_int, /* .../ipv4/tcp_keepalive_intvl */
lxpr_read_sys_net_ipv4_tcp_ka_tim, /* .../ipv4/tcp_keepalive_time */
@@ -971,10 +974,12 @@ static void (*lxpr_read_function[LXPR_NFILES])() = {
lxpr_read_vmstat, /* /proc/vmstat */
};
+CTASSERT(ARRAY_SIZE(lxpr_read_function) == LXPR_NFILES);
+
/*
* Array of lookup functions, indexed by lx /proc file type.
*/
-static vnode_t *(*lxpr_lookup_function[LXPR_NFILES])() = {
+static vnode_t *(*lxpr_lookup_function[])() = {
NULL, /* invalid */
lxpr_lookup_procdir, /* /proc */
lxpr_lookup_piddir, /* /proc/<pid> */
@@ -1105,6 +1110,12 @@ static vnode_t *(*lxpr_lookup_function[LXPR_NFILES])() = {
lxpr_lookup_not_a_dir, /* .../icmp_echo_ignore_broadcasts */
lxpr_lookup_not_a_dir, /* .../net/ipv4/ip_forward */
lxpr_lookup_not_a_dir, /* .../net/ipv4/ip_local_port_range */
+ /* .../tcp_allowed_congestion_control */
+ lxpr_lookup_not_a_dir,
+ /* .../tcp_available_congestion_control */
+ lxpr_lookup_not_a_dir,
+ /* .../tcp_congestion_control */
+ lxpr_lookup_not_a_dir,
lxpr_lookup_not_a_dir, /* .../net/ipv4/tcp_fin_timeout */
lxpr_lookup_not_a_dir, /* .../net/ipv4/tcp_keepalive_intvl */
lxpr_lookup_not_a_dir, /* .../net/ipv4/tcp_keepalive_time */
@@ -1132,10 +1143,12 @@ static vnode_t *(*lxpr_lookup_function[LXPR_NFILES])() = {
lxpr_lookup_not_a_dir, /* /proc/vmstat */
};
+CTASSERT(ARRAY_SIZE(lxpr_lookup_function) == LXPR_NFILES);
+
/*
* Array of readdir functions, indexed by /proc file type.
*/
-static int (*lxpr_readdir_function[LXPR_NFILES])() = {
+static int (*lxpr_readdir_function[])() = {
NULL, /* invalid */
lxpr_readdir_procdir, /* /proc */
lxpr_readdir_piddir, /* /proc/<pid> */
@@ -1266,6 +1279,12 @@ static int (*lxpr_readdir_function[LXPR_NFILES])() = {
lxpr_readdir_not_a_dir, /* .../icmp_echo_ignore_broadcasts */
lxpr_readdir_not_a_dir, /* .../net/ipv4/ip_forward */
lxpr_readdir_not_a_dir, /* .../net/ipv4/ip_local_port_range */
+ /* .../tcp_allowed_congestion_control */
+ lxpr_readdir_not_a_dir,
+ /* .../tcp_available_congestion_control */
+ lxpr_readdir_not_a_dir,
+ /* .../tcp_congestion_control */
+ lxpr_readdir_not_a_dir,
lxpr_readdir_not_a_dir, /* .../net/ipv4/tcp_fin_timeout */
lxpr_readdir_not_a_dir, /* .../net/ipv4/tcp_keepalive_intvl */
lxpr_readdir_not_a_dir, /* .../net/ipv4/tcp_keepalive_time */
@@ -1293,6 +1312,7 @@ static int (*lxpr_readdir_function[LXPR_NFILES])() = {
lxpr_readdir_not_a_dir, /* /proc/vmstat */
};
+CTASSERT(ARRAY_SIZE(lxpr_readdir_function) == LXPR_NFILES);
/*
* lxpr_read(): Vnode operation for VOP_READ()