Skip to content

Commit f9c9104

Browse files
damien-lemoalaxboe
authored andcommitted
null_blk: Fix zone reset all tracing
In the cae of the REQ_OP_ZONE_RESET_ALL operation, the command sector is ignored and the operation is applied to all sequential zones. For these commands, tracing the effect of the command using the command sector to determine the target zone is thus incorrect. Fix null_zone_mgmt() zone condition tracing in the case of REQ_OP_ZONE_RESET_ALL to apply tracing to all sequential zones that are not already empty. Fixes: 766c329 ("null_blk: add trace in null_blk_zoned.c") Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Cc: stable@vger.kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b40813d commit f9c9104

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/block/null_blk_zoned.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,14 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
475475

476476
switch (op) {
477477
case REQ_OP_ZONE_RESET_ALL:
478-
for (i = dev->zone_nr_conv; i < dev->nr_zones; i++)
479-
null_reset_zone(dev, &dev->zones[i]);
480-
break;
478+
for (i = dev->zone_nr_conv; i < dev->nr_zones; i++) {
479+
zone = &dev->zones[i];
480+
if (zone->cond != BLK_ZONE_COND_EMPTY) {
481+
null_reset_zone(dev, zone);
482+
trace_nullb_zone_op(cmd, i, zone->cond);
483+
}
484+
}
485+
return BLK_STS_OK;
481486
case REQ_OP_ZONE_RESET:
482487
ret = null_reset_zone(dev, zone);
483488
break;

0 commit comments

Comments
 (0)