summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/dev/sdev_subr.c
diff options
context:
space:
mode:
authorJohn Levon <john.levon@sun.com>2010-07-26 11:11:38 -0700
committerJohn Levon <john.levon@sun.com>2010-07-26 11:11:38 -0700
commit67323fc4f7476c5e8b55a5fe505c6f2dbf00e89a (patch)
treeaf030066a90e98c42fe98cadbdc5f8a5b9b81aff /usr/src/uts/common/fs/dev/sdev_subr.c
parentda060432c3093844dd0ff46d9651bdf06c12dd66 (diff)
downloadillumos-gate-67323fc4f7476c5e8b55a5fe505c6f2dbf00e89a.tar.gz
6968425 Seeing build_devlink_list: readlink failed messages in console with Osolb143
Diffstat (limited to 'usr/src/uts/common/fs/dev/sdev_subr.c')
-rw-r--r--usr/src/uts/common/fs/dev/sdev_subr.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/dev/sdev_subr.c b/usr/src/uts/common/fs/dev/sdev_subr.c
index a47493ab55..b814175e8a 100644
--- a/usr/src/uts/common/fs/dev/sdev_subr.c
+++ b/usr/src/uts/common/fs/dev/sdev_subr.c
@@ -547,8 +547,22 @@ static struct sdev_vop_table vtab[] =
{ "ipnet", devipnet_vnodeops_tbl, NULL, &devipnet_vnodeops,
devipnet_validate, SDEV_DYNAMIC | SDEV_VTOR | SDEV_NO_NCACHE },
- { "lofi", NULL, NULL, NULL, NULL, SDEV_ZONED },
- { "rlofi", NULL, NULL, NULL, NULL, SDEV_ZONED },
+ /*
+ * SDEV_DYNAMIC: prevent calling out to devfsadm, since only the
+ * lofi driver controls child nodes.
+ *
+ * SDEV_PERSIST: ensure devfsadm knows to clean up any persisted
+ * stale nodes (e.g. from devfsadm -R).
+ *
+ * In addition, devfsadm knows not to attempt a rmdir: a zone
+ * may hold a reference, which would zombify the node,
+ * preventing a mkdir.
+ */
+
+ { "lofi", NULL, NULL, NULL, NULL,
+ SDEV_ZONED | SDEV_DYNAMIC | SDEV_PERSIST },
+ { "rlofi", NULL, NULL, NULL, NULL,
+ SDEV_ZONED | SDEV_DYNAMIC | SDEV_PERSIST },
{ NULL, NULL, NULL, NULL, NULL, 0}
};
@@ -1531,6 +1545,13 @@ sdev_filldir_dynamic(struct sdev_node *ddv)
vap->va_mtime = vap->va_atime;
vap->va_ctime = vap->va_atime;
for (i = 0; vtab[i].vt_name != NULL; i++) {
+ /*
+ * This early, we may be in a read-only /dev
+ * environment: leave the creation of any nodes we'd
+ * attempt to persist to devfsadm.
+ */
+ if (vtab[i].vt_flags & SDEV_PERSIST)
+ continue;
nm = vtab[i].vt_name;
ASSERT(RW_WRITE_HELD(&ddv->sdev_contents));
dv = NULL;