summaryrefslogtreecommitdiff
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2021-07-27 16:45:13 +0300
committerMike Snitzer <snitzer@redhat.com>2021-08-10 20:27:48 +0300
commitdf699cc16ea5ef93a917676dcdd4376e02860ad5 (patch)
tree42f36f10ae9c97497f16440df12823a5b8b7d662 /drivers/md/dm-writecache.c
parent15cb6f39dbaf391dd3b70389c2882df998d5189a (diff)
downloadlinux-df699cc16ea5ef93a917676dcdd4376e02860ad5.tar.xz
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/dm-writecache.c')
-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;
}
}