Skip to content

Commit 79a85e2

Browse files
keithbuschaxboe
authored andcommitted
null_blk: Fix zoned command return code
The return code from null_handle_zoned() sets the cmd->error value. Returning OK status when an error occured overwrites the intended cmd->error. Return the appropriate error code instead of setting the error in the cmd. Fixes: fceb5d1 ("null_blk: create a helper for zoned devices") Cc: Chaitanya Kulkarni <[email protected]> Signed-off-by: Keith Busch <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 8a99734 commit 79a85e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/block/null_blk_zoned.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ static blk_status_t null_zone_reset(struct nullb_cmd *cmd, sector_t sector)
142142
zone->wp = zone->start;
143143
break;
144144
default:
145-
cmd->error = BLK_STS_NOTSUPP;
146-
break;
145+
return BLK_STS_NOTSUPP;
147146
}
148147
return BLK_STS_OK;
149148
}

0 commit comments

Comments
 (0)