freebsd-dev/sys/fs
Konstantin Belousov de10ffa527 Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls
destroy_dev() from d_close() cdev method would self-deadlock.
devfs_close() bump device thread reference counter, and destroy_dev()
sleeps, waiting for si_threadcount to reach zero for cdev without
d_purge method.

destroy_dev_sched() could be used instead from d_close(), to
schedule execution of destroy_dev() in another context. The
destroy_dev_sched_drain() function can be used to drain the scheduled
calls to destroy_dev_sched(). Similarly, drain_dev_clone_events() drains
the events clone to make sure no lingering devices are left after
dev_clone event handler deregistered.

make_dev_credf(MAKEDEV_REF) function should be used from dev_clone
event handlers instead of make_dev()/make_dev_cred() to ensure that created
device has reference counter bumped before cdev mutex is dropped inside
make_dev().

Reviewed by:	tegge (early versions), njl (programming interface)
Debugging help and testing by:	Peter Holm
Approved by:	re (kensmith)
2007-07-03 17:42:37 +00:00
..
cd9660 Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
coda Revert UF_OPENING workaround for CURRENT. 2007-05-31 11:51:53 +00:00
deadfs Below is slightly edited description of the LOR by Tor Egge: 2007-01-22 11:25:22 +00:00
devfs Since rev. 1.199 of sys/kern/kern_conf.c, the thread that calls 2007-07-03 17:42:37 +00:00
fdescfs Replace custom file descriptor array sleep lock constructed using a mutex 2007-04-04 09:11:34 +00:00
fifofs Revert UF_OPENING workaround for CURRENT. 2007-05-31 11:51:53 +00:00
hpfs Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
msdosfs Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in 2007-06-12 00:12:01 +00:00
ntfs Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
nullfs Where I previously removed calls to kdb_enter(), now remove include of 2007-05-29 11:28:28 +00:00
nwfs Change the VOP_OPEN(), vn_open() vnode operation and d_fdopen() cdev operation 2007-06-01 14:33:11 +00:00
portalfs Make insmntque() externally visibile and allow it to fail (e.g. during 2007-03-13 01:50:27 +00:00
procfs Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); in 2007-06-12 00:12:01 +00:00
pseudofs Fix off-by-one error (introduced in r1.60) that had the effect of 2007-06-07 15:04:30 +00:00
smbfs Do proper "locking" for missing vmmeters part. 2007-06-04 21:45:18 +00:00
tmpfs MFp4: 2007-06-29 05:23:15 +00:00
udf Correct corrupt read when the read starts at a non-aligned offset. 2007-06-11 20:14:44 +00:00
unionfs Revert UF_OPENING workaround for CURRENT. 2007-05-31 11:51:53 +00:00