Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

zloop: make the write pointer of full zones invalid

The write pointer of zones that are in the full condition is always
invalid. Reflect that fact by setting the write pointer of full zones
to ULLONG_MAX.

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>

authored by

Damien Le Moal and committed by
Jens Axboe
866d6574 6483faa3

+5 -3
+5 -3
drivers/block/zloop.c
··· 177 177 zone->wp = zone->start; 178 178 } else if (file_sectors == zlo->zone_capacity) { 179 179 zone->cond = BLK_ZONE_COND_FULL; 180 - zone->wp = zone->start + zlo->zone_size; 180 + zone->wp = ULLONG_MAX; 181 181 } else { 182 182 zone->cond = BLK_ZONE_COND_CLOSED; 183 183 zone->wp = zone->start + file_sectors; ··· 326 326 } 327 327 328 328 zone->cond = BLK_ZONE_COND_FULL; 329 - zone->wp = zone->start + zlo->zone_size; 329 + zone->wp = ULLONG_MAX; 330 330 clear_bit(ZLOOP_ZONE_SEQ_ERROR, &zone->flags); 331 331 332 332 unlock: ··· 433 433 * copmpletes. 434 434 */ 435 435 zone->wp += nr_sectors; 436 - if (zone->wp == zone_end) 436 + if (zone->wp == zone_end) { 437 437 zone->cond = BLK_ZONE_COND_FULL; 438 + zone->wp = ULLONG_MAX; 439 + } 438 440 } 439 441 440 442 rq_for_each_bvec(tmp, rq, rq_iter)