提交 cd4e4243 编写于 作者: S Stefan Haberland 提交者: Zheng Zengkai

s390/dasd: fix hanging IO request during DASD driver unbind

commit 66f669a2 upstream.

Prevent that an IO request is build during device shutdown initiated by
a driver unbind. This request will never be able to be processed or
canceled and will hang forever. This will lead also to a hanging unbind.

Fix by checking not only if the device is in READY state but also check
that there is no device offline initiated before building a new IO request.

Fixes: e443343e ("s390/dasd: blk-mq conversion")

Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: NStefan Haberland <sth@linux.ibm.com>
Tested-by: NBjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: NJan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 d06484f2
...@@ -2940,7 +2940,8 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx, ...@@ -2940,7 +2940,8 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx,
basedev = block->base; basedev = block->base;
spin_lock_irq(&dq->lock); spin_lock_irq(&dq->lock);
if (basedev->state < DASD_STATE_READY) { if (basedev->state < DASD_STATE_READY ||
test_bit(DASD_FLAG_OFFLINE, &basedev->flags)) {
DBF_DEV_EVENT(DBF_ERR, basedev, DBF_DEV_EVENT(DBF_ERR, basedev,
"device not ready for request %p", req); "device not ready for request %p", req);
rc = BLK_STS_IOERR; rc = BLK_STS_IOERR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册