]> git.baikalelectronics.ru Git - kernel.git/commit
ide: ensure atapi sense request aren't preempted
authorJens Axboe <axboe@kernel.dk>
Wed, 30 Jan 2019 15:41:40 +0000 (08:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 31 Jan 2019 15:25:09 +0000 (08:25 -0700)
commitd127aca0a70c2ba7233d233a0cdfa6da856eae59
treeda65822cbac6defce676db665ea2ffb4cb89903b
parenta06a102599f9f2d3133bef0e6c8ee26175c04b2e
ide: ensure atapi sense request aren't preempted

There's an issue with how sense requests are handled in IDE. If ide-cd
encounters an error, it queues a sense request. With how IDE request
handling is done, this is the next request we need to handle. But it's
impossible to guarantee this, as another request could come in between
the sense being queued, and ->queue_rq() being run and handling it. If
that request ALSO fails, then we attempt to doubly queue the single
sense request we have.

Since we only support one active request at the time, defer request
processing when a sense request is queued.

Fixes: 1062ae5a15a9 "ide: convert to blk-mq"
Reported-by: He Zhe <zhe.he@windriver.com>
Tested-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ide/ide-atapi.c
drivers/ide/ide-io.c
drivers/ide/ide-park.c
drivers/ide/ide-probe.c
include/linux/ide.h