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>
This commit is contained in:
Mikulas Patocka 2021-07-27 09:45:13 -04:00 committed by Mike Snitzer
parent 15cb6f39db
commit df699cc16e

View File

@ -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;
}
}