[ldv-project] [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device

Greg Kroah-Hartman gregkh at linuxfoundation.org
Sat Mar 9 00:59:40 MSK 2013


On Sat, Mar 09, 2013 at 12:50:47AM +0800, 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.

But that's for userspace drivers, why does it matter here for them?

> All the allocations fixed are under usb_lock_device() from usbdev_do_ioctl().

I really don't want to have usbfs using GFP_NOIO as it is known for
allocating a lot of memory already.  Given that no one has ever reported
a problem like this, I don't think it deserves to change, sorry.

greg k-h



More information about the ldv-project mailing list