If some "writecache_map_*" function returns invalid status, it is a bug.
So, we should report it and not fail silently.

Signed-off-by: Mikulas Patocka <[email protected]>

---
 drivers/md/dm-writecache.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/md/dm-writecache.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-writecache.c   2021-07-27 15:29:19.000000000 
+0200
+++ linux-2.6/drivers/md/dm-writecache.c        2021-07-27 15:37:30.000000000 
+0200
@@ -1585,10 +1585,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;
        }
 }
 

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to