Skip to content

Commit df699cc

Browse files
Mikulas Patockasnitm
authored andcommitted
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 <[email protected]> Signed-off-by: Mike Snitzer <[email protected]>
1 parent 15cb6f3 commit df699cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/md/dm-writecache.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,10 +1545,13 @@ static int writecache_map(struct dm_target *ti, struct bio *bio)
15451545
return DM_MAPIO_SUBMITTED;
15461546

15471547
case WC_MAP_ERROR:
1548-
default:
15491548
wc_unlock(wc);
15501549
bio_io_error(bio);
15511550
return DM_MAPIO_SUBMITTED;
1551+
1552+
default:
1553+
BUG();
1554+
return -1;
15521555
}
15531556
}
15541557

0 commit comments

Comments
 (0)