mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
null_blk: fix spurious IO errors after failed past-wp access
[ Upstream commit ff77042296
]
Steps to reproduce:
BLKRESETZONE zone 0
// force EIO
pwrite(fd, buf, 4096, 4096);
[issue more IO including zone ioctls]
It will start failing randomly including IO to unrelated zones because of
->error "reuse". Trigger can be partition detection as well if test is not
run immediately which is even more entertaining.
The fix is of course to clear ->error where necessary.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3e57e69bb3
commit
fe5b2e54d6
1 changed files with 2 additions and 0 deletions
|
@ -571,6 +571,7 @@ static struct nullb_cmd *__alloc_cmd(struct nullb_queue *nq)
|
||||||
if (tag != -1U) {
|
if (tag != -1U) {
|
||||||
cmd = &nq->cmds[tag];
|
cmd = &nq->cmds[tag];
|
||||||
cmd->tag = tag;
|
cmd->tag = tag;
|
||||||
|
cmd->error = BLK_STS_OK;
|
||||||
cmd->nq = nq;
|
cmd->nq = nq;
|
||||||
if (nq->dev->irqmode == NULL_IRQ_TIMER) {
|
if (nq->dev->irqmode == NULL_IRQ_TIMER) {
|
||||||
hrtimer_init(&cmd->timer, CLOCK_MONOTONIC,
|
hrtimer_init(&cmd->timer, CLOCK_MONOTONIC,
|
||||||
|
@ -1433,6 +1434,7 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||||
cmd->timer.function = null_cmd_timer_expired;
|
cmd->timer.function = null_cmd_timer_expired;
|
||||||
}
|
}
|
||||||
cmd->rq = bd->rq;
|
cmd->rq = bd->rq;
|
||||||
|
cmd->error = BLK_STS_OK;
|
||||||
cmd->nq = nq;
|
cmd->nq = nq;
|
||||||
|
|
||||||
blk_mq_start_request(bd->rq);
|
blk_mq_start_request(bd->rq);
|
||||||
|
|
Loading…
Reference in a new issue