It turns out that devfs_close() does a dev_refthread() before invoking

device specific d_close(), which makes subsequent destroy_dev() being
blocked in the "devdrn" loop.

This bandaid should fix the smbfs hang/crashing observed on -CURRENT since
the introduction of sys/kern/kern_conf.c:1.199:

 	# mount_smbfs -I server //server/share /mnt
 	Password:
 	[hang]

Reviewed by:	bp
See also:	http://lists.freebsd.org/pipermail/cvs-src/2006-November/071379.html
This commit is contained in:
Tai-hwa Liang 2007-02-09 02:54:13 +00:00
parent 3c0bb7340e
commit c6b54e61cc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166580

View File

@ -175,6 +175,7 @@ nsmb_dev_close(struct cdev *dev, int flag, int fmt, struct thread *td)
*/
dev->si_drv1 = NULL;
free(sdp, M_NSMBDEV);
dev_relthread(dev); /* XXX dealing with si_threadcount */
destroy_dev(dev);
splx(s);
return 0;