]> git.baikalelectronics.ru Git - kernel.git/commit
dm zoned: improve error handling in reclaim
authorDmitry Fomichev <dmitry.fomichev@wdc.com>
Sat, 10 Aug 2019 21:43:09 +0000 (14:43 -0700)
committerMike Snitzer <snitzer@redhat.com>
Thu, 15 Aug 2019 19:57:40 +0000 (15:57 -0400)
commit525118e9cd74f893cbfd21b7f22fce92436aa0f6
tree6abae89e96c65649665dad40d8a866bb5569a4b5
parent6e57cb341e18f71689cfbe4018bb2a4d114b7163
dm zoned: improve error handling in reclaim

There are several places in reclaim code where errors are not
propagated to the main function, dmz_reclaim(). This function
is responsible for unlocking zones that might be still locked
at the end of any failed reclaim iterations. As the result,
some device zones may be left permanently locked for reclaim,
degrading target's capability to reclaim zones.

This patch fixes these issues as follows -

Make sure that dmz_reclaim_buf(), dmz_reclaim_seq_data() and
dmz_reclaim_rnd_data() return error codes to the caller.

dmz_reclaim() function is renamed to dmz_do_reclaim() to avoid
clashing with "struct dmz_reclaim" and is modified to return the
error to the caller.

dmz_get_zone_for_reclaim() now returns an error instead of NULL
pointer and reclaim code checks for that error.

Error logging/debug messages are added where necessary.

Fixes: a7416f809f04 ("dm zoned: drive-managed zoned block device target")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-zoned-metadata.c
drivers/md/dm-zoned-reclaim.c