Commit df699cc1 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer

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: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 15cb6f39
...@@ -1545,10 +1545,13 @@ static int writecache_map(struct dm_target *ti, struct bio *bio) ...@@ -1545,10 +1545,13 @@ static int writecache_map(struct dm_target *ti, struct bio *bio)
return DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
case WC_MAP_ERROR: case WC_MAP_ERROR:
default:
wc_unlock(wc); wc_unlock(wc);
bio_io_error(bio); bio_io_error(bio);
return DM_MAPIO_SUBMITTED; return DM_MAPIO_SUBMITTED;
default:
BUG();
return -1;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment