|
@@ -1341,11 +1341,14 @@ static int ubd_queue_one_vec(struct blk_mq_hw_ctx *hctx, struct request *req,
|
|
static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
|
static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
|
const struct blk_mq_queue_data *bd)
|
|
const struct blk_mq_queue_data *bd)
|
|
{
|
|
{
|
|
|
|
+ struct ubd *ubd_dev = hctx->queue->queuedata;
|
|
struct request *req = bd->rq;
|
|
struct request *req = bd->rq;
|
|
int ret = 0;
|
|
int ret = 0;
|
|
|
|
|
|
blk_mq_start_request(req);
|
|
blk_mq_start_request(req);
|
|
|
|
|
|
|
|
+ spin_lock_irq(&ubd_dev->lock);
|
|
|
|
+
|
|
if (req_op(req) == REQ_OP_FLUSH) {
|
|
if (req_op(req) == REQ_OP_FLUSH) {
|
|
ret = ubd_queue_one_vec(hctx, req, 0, NULL);
|
|
ret = ubd_queue_one_vec(hctx, req, 0, NULL);
|
|
} else {
|
|
} else {
|
|
@@ -1361,9 +1364,11 @@ static blk_status_t ubd_queue_rq(struct blk_mq_hw_ctx *hctx,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
out:
|
|
out:
|
|
- if (ret < 0) {
|
|
|
|
|
|
+ spin_unlock_irq(&ubd_dev->lock);
|
|
|
|
+
|
|
|
|
+ if (ret < 0)
|
|
blk_mq_requeue_request(req, true);
|
|
blk_mq_requeue_request(req, true);
|
|
- }
|
|
|
|
|
|
+
|
|
return BLK_STS_OK;
|
|
return BLK_STS_OK;
|
|
}
|
|
}
|
|
|
|
|