null_blk: fix spurious IO errors after failed past-wp access
authorAlexey Dobriyan <adobriyan@gmail.com>
Wed, 12 Feb 2020 20:23:20 +0000 (23:23 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 12 Mar 2020 15:10:03 +0000 (09:10 -0600)
commitff77042296d0a54535ddf74412c5ae92cb4ec76a
tree984b1bac68de1669893f7341ccb6abfcff59ff21
parent2c272542baee2c3b9e8e3a260db81227ccefe8b5
null_blk: fix spurious IO errors after failed past-wp access

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>
drivers/block/null_blk_main.c