From: Mikulas Patocka Date: Tue, 27 Jul 2021 13:45:13 +0000 (-0400) Subject: dm writecache: report invalid return from writecache_map helpers X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=df699cc16ea5ef93a917676dcdd4376e02860ad5;p=linux.git dm writecache: report invalid return from writecache_map helpers If some "writecache_map_*" function returns invalid state, it is a bug. So, we should report it and not fail silently. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index 64d7a798244ab..e89868cf7d984 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1545,10 +1545,13 @@ done: return DM_MAPIO_SUBMITTED; case WC_MAP_ERROR: - default: wc_unlock(wc); bio_io_error(bio); return DM_MAPIO_SUBMITTED; + + default: + BUG(); + return -1; } }