Ignore devfs directory entries for devices either being destroyed or
delisted. The check is racy. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
438e86ce0c
commit
a57a934a38
@ -192,6 +192,16 @@ devfs_find(struct devfs_dirent *dd, const char *name, int namelen, int type)
|
||||
continue;
|
||||
if (type != 0 && type != de->de_dirent->d_type)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* The race with finding non-active name is not
|
||||
* completely closed by the check, but it is similar
|
||||
* to the devfs_allocv() in making it unlikely enough.
|
||||
*/
|
||||
if (de->de_dirent->d_type == DT_CHR &&
|
||||
(de->de_cdp->cdp_flags & CDP_ACTIVE) == 0)
|
||||
continue;
|
||||
|
||||
if (bcmp(name, de->de_dirent->d_name, namelen) != 0)
|
||||
continue;
|
||||
break;
|
||||
|
@ -1045,6 +1045,9 @@ devfs_mknod(struct vop_mknod_args *ap)
|
||||
TAILQ_FOREACH(de, &dd->de_dlist, de_list) {
|
||||
if (cnp->cn_namelen != de->de_dirent->d_namlen)
|
||||
continue;
|
||||
if (de->de_dirent->d_type == DT_CHR &&
|
||||
(de->de_cdp->cdp_flags & CDP_ACTIVE) == 0)
|
||||
continue;
|
||||
if (bcmp(cnp->cn_nameptr, de->de_dirent->d_name,
|
||||
de->de_dirent->d_namlen) != 0)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user