]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
zloop: fail zone append operations that are targeting full zones
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 15 Nov 2025 12:15:52 +0000 (21:15 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:28 +0000 (12:57 +0100)
commit cf28f6f923cb1dd2765b5c3d7697bb4dcf2096a0 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: eb0570c7df23 ("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>
drivers/block/zloop.c

index a423228e201ba3c7c53b69df429543c4e79a93bf..e0123c16040d7b0cf2eeb88359608c11c479088c 100644 (file)
@@ -407,6 +407,10 @@ static void zloop_rw(struct zloop_cmd *cmd)
                mutex_lock(&zone->lock);
 
                if (is_append) {
+                       if (zone->cond == BLK_ZONE_COND_FULL) {
+                               ret = -EIO;
+                               goto unlock;
+                       }
                        sector = zone->wp;
                        cmd->sector = sector;
                }