Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31c02782 authored by Stefan Haberland's avatar Stefan Haberland Committed by Greg Kroah-Hartman
Browse files

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



commit 66f669a272898feb1c69b770e1504aa2ec7723d1 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: default avatarStefan Haberland <sth@linux.ibm.com>
Tested-by: default avatarBjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bccaf335
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2940,7 +2940,8 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx,

	basedev = block->base;
	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,
			      "device not ready for request %p", req);
		rc = BLK_STS_IOERR;