block: don't return 1 for the fallback case in blkdev_get_zone_info
Subsystems (2)
blkdev_do_report_zones returns the number of reported zones, but blkdev_get_zone_info returns 0 or an errno. Translate to the expected return value in blkdev_report_zone_fallback.
--- block/blk-zoned.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
block/blk-zoned.c +7 -1
@@ -895,8 +895,14 @@ static int blkdev_report_zone_fallback(struct block_device *bdev, .data = zone, .report_active = true, }; +int error; -return blkdev_do_report_zones (bdev, sector,1 , &args); + error =blkdev_do_report_zones (bdev, sector,1 , &args); +if (error <0 ) +return error; +if (error ==0 ) +return -EIO ; +return 0 ; }/*
Signature · 1 line
2.47.3
Quoted 6 lines · Christoph Hellwig
blkdev_do_report_zonesreturns the number of reported zones, butblkdev_get_zone_inforeturns 0 or an errno. Translate to the expected return value inblkdev_report_zone_fallback.Fixes b037d41762fd ("block: introduce blkdev_get_zone_info()")Signed-off-by Christoph Hellwig <[email protected]>
Doh! Of course...
Note: Is this patch alone or part of a series ? (the subject has the odd 3/2...)
Signature · 2 lines
Damien Le Moal Western Digital Research
Quoted 2 lines · Damien Le Moal
Note: Is this patch alone or part of a series ?
(the subject has the odd 3/2...)
Yeah, this was supposed to be a follow up to the report zones caching fixes, but I edited out the in-reply-to header accidentally.
Quoted 5 lines · Christoph Hellwig
blkdev_do_report_zonesreturns the number of reported zones, butblkdev_get_zone_inforeturns 0 or an errno. Translate to the expected return value inblkdev_report_zone_fallback.
Applied, thanks!
[3/3] block: don't return 1 for the fallback case in blkdev_get_zone_info
commit: 86a9ce21f5b781c56eba23cbbd2264ab74778ab0
Best regards,
Signature · 1 line
Jens Axboe