diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2020-11-20 10:55:12 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-30 11:54:29 +0100 |
commit | c13edadf1029a4c2f4c8440575bc1e4e483ac585 (patch) | |
tree | c22a97eb87f78e45b7b1a171753f032ee658ebb0 | |
parent | 92ee9b9fa8a463fc4053f3053efc49357023e133 (diff) | |
download | linux-stable-c13edadf1029a4c2f4c8440575bc1e4e483ac585.tar.gz linux-stable-c13edadf1029a4c2f4c8440575bc1e4e483ac585.tar.bz2 linux-stable-c13edadf1029a4c2f4c8440575bc1e4e483ac585.zip |
null_blk: Fail zone append to conventional zones
commit 2e896d89510f23927ec393bee1e0570db3d5a6c6 upstream.
Conventional zones do not have a write pointer and so cannot accept zone
append writes. Make sure to fail any zone append write command issued to
a conventional zone.
Reported-by: Naohiro Aota <naohiro.aota@wdc.com>
Fixes: e0489ed5daeb ("null_blk: Support REQ_OP_ZONE_APPEND")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/block/null_blk_zoned.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/null_blk_zoned.c b/drivers/block/null_blk_zoned.c index 1d0370d91fe7..172f720b8d63 100644 --- a/drivers/block/null_blk_zoned.c +++ b/drivers/block/null_blk_zoned.c @@ -339,8 +339,11 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector, trace_nullb_zone_op(cmd, zno, zone->cond); - if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL) + if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL) { + if (append) + return BLK_STS_IOERR; return null_process_cmd(cmd, REQ_OP_WRITE, sector, nr_sectors); + } null_lock_zone(dev, zno); |