The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Hans de Goede <hdegoede@redhat.com>,
	USB list <linux-usb@vger.kernel.org>,
	Kernel development list <linux-kernel@vger.kernel.org>,
	ldv-project@linuxtesting.org
Subject: Re: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device
Date: Fri, 08 Mar 2013 21:46:29 +0100	[thread overview]
Message-ID: <2925850.6XPAdGF0iQ@linux-5eaq.site> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1303081248090.17427-100000@netrider.rowland.org>

On Friday 08 March 2013 12:55:08 Alan Stern wrote:
> On Sat, 9 Mar 2013, Alexey Khoroshilov wrote:
> 
> > As it was described by Oliver Neukum in commit acbe2fe
> > "USB: Don't use GFP_KERNEL while we cannot reset a storage device":
> > 
> >   Memory allocations with GFP_KERNEL can cause IO to a storage device
> >   which can fail resulting in a need to reset the device. Therefore
> >   GFP_KERNEL cannot be safely used between usb_lock_device()
> >   and usb_unlock_device(). Replace by GFP_NOIO.
> > 
> > The patch fixes the same issue in usb/core/devio.c.
> > All the allocations fixed are under usb_lock_device() from usbdev_do_ioctl().
> > 
> > Found by Linux Driver Verification project (linuxtesting.org).
> 
> I don't know if this is a good idea.  People can and do submit 
> transfers requiring a lot of buffer space.  Switching to GFP_NOIO 
> will make those allocations a lot more likely to fail.
> 
> Oliver, what do you think?

Ideally we'd split memory allocation and use, by it fixes a bug.
Better allocation failure than deadlock.

	Regards
		Oliver


  reply	other threads:[~2013-03-08 20:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 16:50 [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device Alexey Khoroshilov
2013-03-08 17:55 ` Alan Stern
2013-03-08 20:46   ` Oliver Neukum [this message]
2013-03-09  2:59     ` Alan Stern
2013-03-08 20:59 ` Greg Kroah-Hartman
2013-03-11 13:31 ` Ming Lei
2013-03-11 15:32   ` Alan Stern
2013-03-11 15:52     ` Ming Lei
2013-03-11 16:08       ` Alan Stern
2013-03-11 16:34         ` Ming Lei
2013-03-11 18:55           ` Alan Stern

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=2925850.6XPAdGF0iQ@linux-5eaq.site \
    --to=oliver@neukum.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=khoroshilov@ispras.ru \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --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