diff options
author | Tony Battersby <tonyb@cybernetics.com> | 2015-02-13 20:09:44 +0300 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2015-02-17 17:55:32 +0300 |
commit | 7568615c1054907ea8c7701ab86dad51aa099888 (patch) | |
tree | 9a8fbf348961fd4970423b51a41ce7ae7b3e0421 /net/atm | |
parent | 3b524a683af8991b4eab4182b947c65f0ce1421b (diff) | |
download | linux-7568615c1054907ea8c7701ab86dad51aa099888.tar.xz |
sg: fix unkillable I/O wait deadlock with scsi-mq
When using the write()/read() interface for submitting commands, the
SCSI generic driver does not call blk_put_request() on a completed SCSI
command until userspace calls read() to get the command completion.
Since scsi-mq uses a fixed number of preallocated requests, this makes
it possible for userspace to exhaust the entire preallocated supply of
requests. For places in the kernel that call blk_get_request() with
GFP_KERNEL, this can cause the calling process to deadlock in a
permanent unkillable I/O wait in blk_get_request() -> ... -> bt_get().
For places in the kernel that call blk_get_request() with GFP_ATOMIC,
this can cause blk_get_request() always to return -EWOULDBLOCK. Note
that these problems happen only if scsi-mq is enabled. Prevent the
problems by calling blk_put_request() as soon as the SCSI command
completes instead of waiting for userspace to call read().
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>
Diffstat (limited to 'net/atm')
0 files changed, 0 insertions, 0 deletions