[PATCH] dm: test return value for DM_MAPIO_SUBMITTED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In properly written code we should not assume that DM_MAPIO_SUBMITTED is
zero. We should test the return value for DM_MAPIO_SUBMITTED rather than
testing it for zero.

Signed-off-by: Mikulas Patocka <mpatocka@xxxxxxxxxx>

---
 drivers/md/dm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-4.1/drivers/md/dm.c
===================================================================
--- linux-4.1.orig/drivers/md/dm.c	2015-06-29 19:38:06.000000000 +0200
+++ linux-4.1/drivers/md/dm.c	2015-06-29 19:38:33.000000000 +0200
@@ -1526,7 +1526,7 @@ static void __map_bio(struct dm_target_i
 		md = tio->io->md;
 		dec_pending(tio->io, r);
 		free_tio(md, tio);
-	} else if (r) {
+	} else if (r != DM_MAPIO_SUBMITTED) {
 		DMWARN("unimplemented target map return value: %d", r);
 		BUG();
 	}

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux