null_blk: Fix zoned command return code
PATCH 1/1 null_blk: Fix zoned command return code
From: Keith Busch <[email protected]>
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 fceb5d1b19cbe626 ("null_blk: create a helper for zoned devices")
Cc Chaitanya Kulkarni <[email protected]>
Signed-off-by Keith Busch <[email protected]>
--- drivers/block/null_blk_zoned.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/null_blk_zoned.c +1 -2
@@ -142,8 +142,7 @@ static blk_status_t null_zone_reset(struct nullb_cmd *cmd, sector_t sector) zone->wp = zone->start;break ;default : - cmd->error =BLK_STS_NOTSUPP ; -break ; +return BLK_STS_NOTSUPP ; }return BLK_STS_OK ; }
Signature · 1 line
2.21.0
Quoted 5 lines · On 10/9/19 9:38 AM, [email protected] wrote:
From: Keith Busch <[email protected]>
The return code from
null_handle_zoned()sets thecmd->errorvalue. Returning OK status when an error occured overwrites the intendedcmd->error. Return the appropriate error code instead of setting the error in the cmd.
Applied, thanks.
Signature · 1 line
Jens Axboe