]> Pileus Git - ~andy/linux/blobdiff - drivers/md/dm-raid1.c
dm raid1: fix crash with mirror recovery and discard
[~andy/linux] / drivers / md / dm-raid1.c
index d039de8322f0a314fca492df4b932289d9033e0d..ea16984c0f082536643a733b6e8b9f9026bde390 100644 (file)
@@ -1214,7 +1214,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
         * We need to dec pending if this was a write.
         */
        if (rw == WRITE) {
-               if (!(bio->bi_rw & REQ_FLUSH))
+               if (!(bio->bi_rw & (REQ_FLUSH | REQ_DISCARD)))
                        dm_rh_dec(ms->rh, map_context->ll);
                return error;
        }