On Tuesday 31 July 2012 15:42:51 Alan Stern wrote: > On Tue, 31 Jul 2012, Oliver Neukum wrote: > > > > Another alternative is for the other drivers to delay the reset (by > > > sleeping in their pre_reset callbacks) until they can handle the reset > > > safely. > > > > No! You must not ever do that! > > > > The reset is a part of the error handling path of the block layer. Therefore > > it must not sleep indefinitely. In particular you must never wait for anything > > user space does or for any part of the kernel that allocates memory with > > GFP_KERNEL or GFP_NOFS, and you must allocate memory only with GFP_NOIO. > > The penalty is deadlock. > > True; it's easy to forget that. Although in practice it's not very > likely to occur. It would require a writable memory-mapped file or > swap partition on a USB drive and a system running low on available > memory. If you refer to allocating memory, yes. Waiting for user space is worse. Any read access to the storage device would deadlock. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html