Commit f9c91042 authored by Damien Le Moal's avatar Damien Le Moal Committed by Jens Axboe

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: 766c3297 ("null_blk: add trace in null_blk_zoned.c")
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b40813dd
...@@ -475,9 +475,14 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op, ...@@ -475,9 +475,14 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
switch (op) { switch (op) {
case REQ_OP_ZONE_RESET_ALL: case REQ_OP_ZONE_RESET_ALL:
for (i = dev->zone_nr_conv; i < dev->nr_zones; i++) for (i = dev->zone_nr_conv; i < dev->nr_zones; i++) {
null_reset_zone(dev, &dev->zones[i]); zone = &dev->zones[i];
break; if (zone->cond != BLK_ZONE_COND_EMPTY) {
null_reset_zone(dev, zone);
trace_nullb_zone_op(cmd, i, zone->cond);
}
}
return BLK_STS_OK;
case REQ_OP_ZONE_RESET: case REQ_OP_ZONE_RESET:
ret = null_reset_zone(dev, zone); ret = null_reset_zone(dev, zone);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment