USB: usbdevfs: restore warning for nonsensical flags
PATCH 2/2 USB: usbdevfs: restore warning for nonsensical flags
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?
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?
Quoted 3 lines
Quoted 1 line
Do you want an extra version for stable?
No, but why was this patch not marked for stable?
I was under the impression that it was. This is a separate patch because you could argue that it is unnecessary or that stable and the next release should diverge on whether to take it.
Regards
Oliver