Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964821Ab3CHRzL (ORCPT ); Fri, 8 Mar 2013 12:55:11 -0500 Received: from netrider.rowland.org ([192.131.102.5]:38404 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S933621Ab3CHRzJ (ORCPT ); Fri, 8 Mar 2013 12:55:09 -0500 Date: Fri, 8 Mar 2013 12:55:08 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Alexey Khoroshilov , Oliver Neukum cc: Greg Kroah-Hartman , Hans de Goede , USB list , Kernel development list , Subject: Re: [PATCH] usb/core/devio.c: Don't use GFP_KERNEL while we cannot reset a storage device In-Reply-To: <1362761447-24643-1-git-send-email-khoroshilov@ispras.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1110 Lines: 28 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? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/