]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
null_blk: synchronization fix for zoned device
authorKanchan Joshi <joshi.k@samsung.com>
Mon, 28 Sep 2020 09:55:49 +0000 (15:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:51:55 +0000 (11:51 +0100)
commit0dc0cd2c6abc44af33cfeda1daf323bf20ef0de0
treecf347c1d09d882c5765764baa5da025dbdeedd97
parent48133352c5e678a31f3f974146e03f3ff4bde11d
null_blk: synchronization fix for zoned device

commit 35bc10b2eafbb701064b94f283b77c54d3304842 upstream.

Parallel write,read,zone-mgmt operations accessing/altering zone state
and write-pointer may get into race. Avoid the situation by using a new
spinlock for zoned device.
Concurrent zone-appends (on a zone) returning same write-pointer issue
is also avoided using this lock.

Cc: stable@vger.kernel.org
Fixes: e0489ed5daeb ("null_blk: Support REQ_OP_ZONE_APPEND")
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/null_blk.h
drivers/block/null_blk_zoned.c