diff options
author | Hannes Reinecke <hare@suse.de> | 2020-05-19 10:14:19 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2020-05-20 23:09:49 +0200 |
commit | 489dc0f06a5837f87482c0ce61d830d24e17082e (patch) | |
tree | 8787113bed64aa4ac4aac191cc583cfd02c574b6 /drivers/md/dm-zoned-reclaim.c | |
parent | dm zoned: Avoid 64-bit division error in dmz_fixup_devices (diff) | |
download | linux-489dc0f06a5837f87482c0ce61d830d24e17082e.tar.xz linux-489dc0f06a5837f87482c0ce61d830d24e17082e.zip |
dm zoned: return NULL if dmz_get_zone_for_reclaim() fails to find a zone
The only case where dmz_get_zone_for_reclaim() cannot return a zone is
if the respective lists are empty. So we should just return a simple
NULL value here as we really don't have an error code which would make
sense.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-zoned-reclaim.c')
-rw-r--r-- | drivers/md/dm-zoned-reclaim.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-zoned-reclaim.c b/drivers/md/dm-zoned-reclaim.c index 7e9b11ee064f..201177ad1f17 100644 --- a/drivers/md/dm-zoned-reclaim.c +++ b/drivers/md/dm-zoned-reclaim.c @@ -352,8 +352,8 @@ static int dmz_do_reclaim(struct dmz_reclaim *zrc) /* Get a data zone */ dzone = dmz_get_zone_for_reclaim(zmd); - if (IS_ERR(dzone)) - return PTR_ERR(dzone); + if (!dzone) + return -EBUSY; start = jiffies; if (dmz_is_rnd(dzone)) { |