usb/46176: Let's save the horse!

Henrik Gulbrandsen henrik at gulbra.net
Sun Dec 30 17:35:52 PST 2007


I have uploaded an updated version of the patch set:

http://www.gulbra.net/freebsd-usb/umass2.tar.gz

Apparently, the original patches didn't help much for the latest version
of FreeBSD-CURRENT, but this version seems to do the trick. I have tried
it with 1001 attach/detach iterations and didn't get a single error.

1001 iterations correspond to about two and a half hours of manual
testing, so that's about as far as I'm prepared to go for today! :-)

As before, here is a quick overview of the contents of umass2.tar.gz:

etc/devd.conf.patch: Hurray! I've updated it to use devd.conf instead of
the obsoleted usbd.conf file. This also means that the usb_subr.c patch
is no longer needed for things to work in this version.

etc/devd/umass: Other things in devd.conf seem to have their scripts in
the rc.d directory, but I didn't want to think about that now, so the
umass script has simply been moved from etc/usbd to etc/devd. Also, the
original script had a bug: I had forgotten to initialize the user data
before attempting to execute the user's .umass script after detaching.
In the current version, user info is fetched from the device directory.

src/msdosfs_vfsops.c.patch: The msdosfs_vfsops.c file had changed in a
radical way, so this is a new patch that should do about the same thing
as the corresponding patch in the original patch set.

src/scsi_da.c.patch: I couldn't help noticing that detaching failed
miserably in the latest CURRENT. Basically, the unmount call attempted
to close the da device, but crashed because the SCSI Interface Module
was already gone. This patch tries to solve it by explicitly calling
daclose as soon as the AC_LOST_DEVICE event is received. I'm hoping to
get away with it, since everything happens within the da device driver,
but some extra code review would probably not hurt...

/Henrik




More information about the freebsd-usb mailing list