USB: usbdevfs: restore warning for nonsensical flags
Greg Kroah-Hartman
maintainerPATCH 2/2 USB: usbdevfs: restore warning for nonsensical flags
Quoted 26 lines · Alan Stern
Quoted 24 lines · Oliver Neukum
Quoted 13 lines · Greg KH
Quoted 12 lines · Oliver Neukum
Quoted 10 lines · Greg KH
Review
Quoted 4 lines · Oliver Neukum
(quoted diff) +4
-0+ if (!allow_short && uurb->flags & USBDEVFS_URB_SHORT_NOT_OK) + dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_SHORT_NOT_OK.\n"); + if (!allow_zero && uurb->flags & USBDEVFS_URB_ZERO_PACKET) + dev_warn(&ps->dev->dev, "Requested nonsensical USBDEVFS_URB_ZERO_PACKET.\n");We should not make it trivial for userspace to spam the kernel log if at all possible. Returning an error is probably the better thing to do here, not just silently fix it up or ignore it.
Quoted 3 lines
Quoted 1 line
That means a change in the API in a way that makes orking systems fail.
Ah, good point.
Well, but do we want to do this in the next major release even if we cannot do it in a stable release?
Quoted 2 lines
I guess they were hitting the same
dev_WARN()messages
today anyway, right?
Quoted 6 lines
Quoted 3 lines
Yes. And for a kernel problem you really want the stack traces. Still, that does not tell us that we want to print a message if user space messes up. So
dev_warn()or nothing?An alternative is for usbfs to silently fix the flags when they are wrong. Would that be any better?
Probably not. I'll take the original patches now and see if there is any complaints by users.
thanks,
greg k-h