Skip to content

Commit c13edad

Browse files
damien-lemoalgregkh
authored andcommitted
null_blk: Fail zone append to conventional zones
commit 2e896d8 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 <[email protected]> Fixes: e0489ed ("null_blk: Support REQ_OP_ZONE_APPEND") Cc: [email protected] Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 92ee9b9 commit c13edad

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/block/null_blk_zoned.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,11 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector,
339339

340340
trace_nullb_zone_op(cmd, zno, zone->cond);
341341

342-
if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL)
342+
if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL) {
343+
if (append)
344+
return BLK_STS_IOERR;
343345
return null_process_cmd(cmd, REQ_OP_WRITE, sector, nr_sectors);
346+
}
344347

345348
null_lock_zone(dev, zno);
346349

0 commit comments

Comments
 (0)