]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 14:11:53 +0000 (16:11 +0200)
commit1c1824532918e9f0917e98eaa8d50843bb399838
treec44ca21fb4d6c6246d0983eafc224a5263b1b289
parentf6b24083f09ac68f136670f2f0fa1475997727a7
null_blk: fix spurious IO errors after failed past-wp access

[ Upstream commit ff77042296d0a54535ddf74412c5ae92cb4ec76a ]

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