Skip to contentSkip to conversation

dm-integrity: fix wrong fallthrough in integrity_bio_wait

PATCH New Mikulas Patocka 1 participant 1 message Jul 13 Device mapper

lore
Share & tools
lore

Mikulas Patocka

author maintainer
#0 lore raw

PATCH 1/1 dm-integrity: fix wrong fallthrough in integrity_bio_wait

If dm_integrity_map_inline returned DM_MAPIO_KILL, the code would set status BLK_STS_IOERR and then incorrectly fall through and submit the bio. Luckily, dm_integrity_map_inline can't return DM_MAPIO_KILL at this point, so the bug is just theoretical.

Assisted-by Claude:claude-opus-4.6
---
 drivers/md/dm-integrity.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/dm-integrity.c +2 -1
Index: linux-2.6/drivers/md/dm-integrity.c
===================================================================
@@ -2782,7 +2782,8 @@ static void integrity_bio_wait(struct wo
 		switch (r) {
 			case DM_MAPIO_KILL:
 				bio->bi_status = BLK_STS_IOERR;
-				fallthrough;
+				bio_endio(bio);
+				return;
 			case DM_MAPIO_REMAPPED:
 				submit_bio_noacct(bio);
 				fallthrough;