dm: test return value for DM_MAPIO_SUBMITTED
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 1 Jul 2015 21:30:36 +0000 (17:30 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 12 Aug 2015 15:32:20 +0000 (11:32 -0400)
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@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm.c

index 0d7ab20c58dffc40d5c56c9427b7dd7f090c8bd3..0907d9eb864ee79750c5f04dd8206672a659c3b2 100644 (file)
@@ -1466,7 +1466,7 @@ static void __map_bio(struct dm_target_io *tio)
                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();
        }