aboutsummaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMikulas Patocka2021-07-27 09:45:13 -0400
committerMike Snitzer2021-08-10 13:27:48 -0400
commitdf699cc16ea5ef93a917676dcdd4376e02860ad5 (patch)
tree42f36f10ae9c97497f16440df12823a5b8b7d662 /drivers/md
parent15cb6f39dbaf391dd3b70389c2882df998d5189a (diff)
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 <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-writecache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 64d7a798244a..e89868cf7d98 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;
}
}