usb/umass, devfs: this sucks

Henrik Gulbrandsen henrik at gulbra.net
Wed Dec 26 15:58:17 PST 2007


On Wed, 2007-12-26 at 11:48 -0700, M. Warner Losh wrote:
> In message: <1198689316.1119.382.camel at Particle>
>             Henrik Gulbrandsen <henrik at gulbra.net> writes:
> : Look at it from my perspective: I would be happy to complete my fix for
> : the infamous five-year-old usb/46176, so people can finally detach umass
> : devices without having to manually unmount them first. However, it will
> : undoubtedly take a non-trivial amount of time to reproduce and eliminate
> : the remaining issues.
> 
> There's no patches in this bug.

Correct. I was hoping to have a complete fix before making any official
announcements, especially since the approach may be a bit controversial.
Fixing underlying issues one by one is not necessarily as clean as doing
a complete redesign, but it's pretty efficient and good for merging too.

The patches to CURRENT were described in this post to the USB list:
http://lists.freebsd.org/pipermail/freebsd-usb/2007-November/004127.html


> : I'm more likely to put in that effort if I believe
> : that my patches may actually end up in CURRENT, but if a one-line fix
> : such as that in usb/78984 has not been applied after more than a year,
> : how long will it take for patches that involve multiple subsystems?
> 
> The patch in this bug is wrong.  There are devices that are an odd
> number of sectors.  This is one of the places where the obvious patch
> isn't necessarily right.

You're right. I realized that myself right after I sent the first email.
The patch was already two years old when I submitted it, and I guess I
must have focused a little too much on solid-state devices with "large"
megabytes, where the sector count is very likely to be a power of two.

The patch can be written as a quirk fix for this specific umass device,
but (as I've mentioned elsewhere) I'd prefer something that handles the
entire category of problems at once. Perhaps an extra line containing
"if (is_power_of_two(maxsector))" could be a working compromise, but
this can be discussed in a smaller setting than the current one.

/Henrik




More information about the freebsd-usb mailing list