sg: fix EWOULDBLOCK errors with scsi-mq
authorTony Battersby <tonyb@cybernetics.com>
Fri, 13 Feb 2015 17:10:58 +0000 (12:10 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 17 Feb 2015 14:57:54 +0000 (06:57 -0800)
commit7772855a996ec6e16944b120ab5ce21050279821
treeee736c6d1316437299d0c6c4948cfbc02f1dff56
parent7568615c1054907ea8c7701ab86dad51aa099888
sg: fix EWOULDBLOCK errors with scsi-mq

With scsi-mq enabled, userspace programs can get unexpected EWOULDBLOCK
(a.k.a. EAGAIN) errors when submitting commands to the SCSI generic
driver.  Fix by calling blk_get_request() with GFP_KERNEL instead of
GFP_ATOMIC.

Note: to avoid introducing a potential deadlock, this patch should be
applied after the patch titled "sg: fix unkillable I/O wait deadlock
with scsi-mq".

Cc: <stable@vger.kernel.org> # 3.17+
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/sg.c