Skip to content

Commit 35eb1ec

Browse files
damien-lemoalgregkh
authored andcommitted
zloop: fail zone append operations that are targeting full zones
commit cf28f6f upstream. zloop_rw() will fail any regular write operation that targets a full sequential zone. The check for this is indirect and achieved by checking the write pointer alignment of the write operation. But this check is ineffective for zone append operations since these are alwasy automatically directed at a zone write pointer. Prevent zone append operations from being executed in a full zone with an explicit check of the zone condition. Fixes: eb0570c ("block: new zoned loop block device driver") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1d18fb5 commit 35eb1ec

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/block/zloop.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,10 @@ static void zloop_rw(struct zloop_cmd *cmd)
407407
mutex_lock(&zone->lock);
408408

409409
if (is_append) {
410+
if (zone->cond == BLK_ZONE_COND_FULL) {
411+
ret = -EIO;
412+
goto unlock;
413+
}
410414
sector = zone->wp;
411415
cmd->sector = sector;
412416
}

0 commit comments

Comments
 (0)