linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oneukum@suse.com>,
	johan@kernel.org, linux-usb@vger.kernel.org
Subject: [2/2] USB: usbdevfs: restore warning for nonsensical flags
Date: Thu, 20 Sep 2018 12:47:06 +0200	[thread overview]
Message-ID: <20180920104706.GB14523@kroah.com> (raw)

On Thu, Sep 06, 2018 at 11:34:04AM -0400, Alan Stern wrote:
> On Thu, 6 Sep 2018, Oliver Neukum wrote:
> 
> > On Mi, 2018-09-05 at 15:07 +0200, Greg KH wrote:
> > > On Wed, Sep 05, 2018 at 03:02:48PM +0200, Oliver Neukum wrote:
> > > > On Mi, 2018-09-05 at 14:19 +0200, Greg KH wrote:
> > > > > On Wed, Sep 05, 2018 at 12:07:03PM +0200, Oliver Neukum wrote:
> > 
> > > > > > +	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.
> > > > 
> > > > 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?
> > 
> > >   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?
> 
> 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

             reply	other threads:[~2018-09-20 10:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 10:47 Greg Kroah-Hartman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-06 15:34 [2/2] USB: usbdevfs: restore warning for nonsensical flags Alan Stern
2018-09-06 10:01 Oliver Neukum
2018-09-05 13:07 Greg Kroah-Hartman
2018-09-05 13:02 Oliver Neukum
2018-09-05 12:19 Greg Kroah-Hartman
2018-09-05 10:07 Oliver Neukum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180920104706.GB14523@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).