Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756158Ab3CHUqP (ORCPT ); Fri, 8 Mar 2013 15:46:15 -0500 Received: from smtp-out003.kontent.com ([81.88.40.217]:60512 "EHLO smtp-out003.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753631Ab3CHUqO (ORCPT ); Fri, 8 Mar 2013 15:46:14 -0500 From: Oliver Neukum To: Alan Stern Cc: Alexey Khoroshilov , Greg Kroah-Hartman , Hans de Goede , USB list , Kernel development list , 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 Message-ID: <2925850.6XPAdGF0iQ@linux-5eaq.site> User-Agent: KMail/4.8.5 (Linux/3.8.0-rc7-12-desktop+; KDE/4.8.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit 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: 1315 Lines: 33 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 -- 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/