freebsd-nq/sys/fs/devfs
Konstantin Belousov 724ce55b5b While fixing the looping of a thread while devfs vnode is reclaimed,
r179247 introduced a possibility of devfs_allocv() returning spurious
ENOENT. If the vnode is selected by vnlru daemon for reclamation, then
devfs_allocv() can get ENOENT from vget() due to devfs_close() dropping
vnode lock around the call to cdevsw d_close method.

Use LK_RETRY in the vget() call, and do some part of the devfs_reclaim()
work in devfs_allocv(), clearing vp->v_data and de->de_vnode. Retry the
allocation of the vnode, now with de->de_vnode == NULL.

The check vp->v_data == NULL at the start of devfs_close() cannot be
affected by the change, since vnode lock must be held while VI_DOOMED
is set, and only dropped after the check.

Reported and tested by:	Kohji Okuno <okuno.kohji jp panasonic com>
Reviewed by:	attilio
MFC after:	3 weeks
2011-07-13 21:07:41 +00:00
..
devfs_devs.c - Assert that dm_lock is exclusively held in devfs_rules_apply() and 2010-12-15 16:42:44 +00:00
devfs_dir.c Add reference counting for devfs paths containing user created symbolic 2010-09-27 17:47:09 +00:00
devfs_int.h Format prototypes to follow style(9) more closely. 2010-10-12 15:58:52 +00:00
devfs_rule.c - Assert that dm_lock is exclusively held in devfs_rules_apply() and 2010-12-15 16:42:44 +00:00
devfs_vfsops.c Enable shared lookups and externed shared ops for devfs. 2010-08-06 09:46:53 +00:00
devfs_vnops.c While fixing the looping of a thread while devfs vnode is reclaimed, 2011-07-13 21:07:41 +00:00
devfs.h Format prototypes to follow style(9) more closely. 2010-10-12 15:58:52 +00:00