diff options
author | kib <kib@FreeBSD.org> | 2015-01-26 11:37:16 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-01-26 11:37:16 +0000 |
commit | b45c95ab3d00e936a65f59496b980ccb8ff0fc86 (patch) | |
tree | 3100f08db90a30dcfc0d1fc3b0103ba08696eb72 /sys/fs/devfs/devfs_devs.c | |
parent | 56e35bcee15b57f716afc619097aeeb529d263d0 (diff) | |
download | FreeBSD-src-b45c95ab3d00e936a65f59496b980ccb8ff0fc86.zip FreeBSD-src-b45c95ab3d00e936a65f59496b980ccb8ff0fc86.tar.gz |
MFC r277390:
Ignore devfs directory entries for devices being destroyed.
Diffstat (limited to 'sys/fs/devfs/devfs_devs.c')
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index e351ff8..c2d40d3 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -186,6 +186,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; |