summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-01-21 17:12:44 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-01-21 17:12:44 +0000
commit71ff7091ac6d6fc4c0bf66b43e60bbf2509f96d1 (patch)
tree7ad86cf07f6f907b05c17bd4c81988e0fdcb42b0
parent5f61927a04d66e0d1f42a7c0f1572de01debacae (diff)
downloadillumos-joyent-release-20160121.tar.gz
OS-5104 user-mode emulation stat(2) gets incorrect st_rdevrelease-20160121
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
-rw-r--r--usr/src/uts/common/brand/lx/devfs/lxd_vnops.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/usr/src/uts/common/brand/lx/devfs/lxd_vnops.c b/usr/src/uts/common/brand/lx/devfs/lxd_vnops.c
index 28474ec99c..75e23aea97 100644
--- a/usr/src/uts/common/brand/lx/devfs/lxd_vnops.c
+++ b/usr/src/uts/common/brand/lx/devfs/lxd_vnops.c
@@ -240,6 +240,15 @@ lxd_getattr(vnode_t *vp, struct vattr *vap, int flags, struct cred *cr,
/* Skip devt translation for native programs */
if (curproc->p_brand != &lx_brand) {
return (0);
+ } else {
+ /*
+ * We also skip translation when called from the user-land
+ * emulation code.
+ */
+ lx_lwp_data_t *lwpd = ttolxlwp(curthread);
+
+ if (lwpd == NULL || lwpd->br_stack_mode != LX_STACK_MODE_BRAND)
+ return (0);
}
if (rvp->v_type == VCHR) {