Re: error returns from ->queue_rq

From: Jens Axboe
Date: Tue Feb 11 2014 - 10:44:16 EST


On Tue, Feb 11 2014, Christoph Hellwig wrote:
> Hi Jens,
>
> seems like with the SCSI work I introduced the first
> BLK_MQ_RQ_QUEUE_ERROR error return in the tree, and immediately ran into
> the first pitfall. The code as-is expects rq->errors set to an error
> value, which otherwise is an internal field used by the block layer and
> some drivers, but not part of the communication protocol between the
> two.
>
> We can either make it part of the protocol for blk-mq, which would
> require documenting and praying driver writers get it right, or
> alternatively we could map BLK_MQ_RQ_QUEUE_ERROR to -EIO and if
> nessecary introduce other return values if we need to return other
> errors. The third option would be to remove BLK_MQ_RQ_QUEUE_ERROR
> entirely and require drivers to call blk_mq_end_io themselves from
> ->queue_rq, mirroring the ->queuecommand error handling. I'm undecided
> between options 2 and 3, but I'd rather avoid the current pitfall.

Lets go for option #2. I agree that we should not make this a new
depedency, it's a lot more robust to just have it be -EIO and add other
error returns as needed.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/