Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143912473
D55028.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55028.id.diff
View Options
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -367,6 +367,9 @@
ASSERT_VOP_LOCKED(vp, "devfs_populate_vp");
+ if (VN_IS_DOOMED(vp))
+ return (ENOENT);
+
dmp = VFSTODEVFS(vp->v_mount);
if (!devfs_populate_needed(dmp)) {
sx_xlock(&dmp->dm_lock);
@@ -1128,8 +1131,25 @@
cdev = NULL;
DEVFS_DMP_HOLD(dmp);
sx_xunlock(&dmp->dm_lock);
+ dvplocked = VOP_ISLOCKED(dvp);
+
+ /*
+ * Invoke the dev_clone handler. Unlock dvp around it
+ * to simplify the cloner operations.
+ *
+ * If dvp is reclaimed while we unlocked it, we return
+ * with ENOENT by some of the paths below. If cloner
+ * returned cdev, then devfs_populate_vp() notes the
+ * reclamation. Otherwise, note that either our devfs
+ * mount is being unmounted, then DEVFS_DMP_DROP()
+ * returns true, and we return ENOENT this way. Or,
+ * because de == NULL, the check for it after the loop
+ * returns ENOENT.
+ */
+ VOP_UNLOCK(dvp);
EVENTHANDLER_INVOKE(dev_clone,
td->td_ucred, pname, strlen(pname), &cdev);
+ vn_lock(dvp, dvplocked | LK_RETRY);
if (cdev == NULL)
sx_xlock(&dmp->dm_lock);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 2, 9:27 PM (14 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28409161
Default Alt Text
D55028.id.diff (1 KB)
Attached To
Mode
D55028: devfs: unlock the directory vnode around the call to dev_clone handler
Attached
Detach File
Event Timeline
Log In to Comment