mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
block: don't return 1 for the fallback case in blkdev_get_zone_info
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.
Fixes: b037d41762fd ("block: introduce blkdev_get_zone_info()")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
bc840b21a2
commit
86a9ce21f5
|
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user