diff options
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r-- | drivers/md/dm-raid1.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 7dfdb5c746d6..089d62751f7f 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -604,6 +604,15 @@ static void write_callback(unsigned long error, void *context) | |||
604 | return; | 604 | return; |
605 | } | 605 | } |
606 | 606 | ||
607 | /* | ||
608 | * If the bio is discard, return an error, but do not | ||
609 | * degrade the array. | ||
610 | */ | ||
611 | if (bio->bi_rw & REQ_DISCARD) { | ||
612 | bio_endio(bio, -EOPNOTSUPP); | ||
613 | return; | ||
614 | } | ||
615 | |||
607 | for (i = 0; i < ms->nr_mirrors; i++) | 616 | for (i = 0; i < ms->nr_mirrors; i++) |
608 | if (test_bit(i, &error)) | 617 | if (test_bit(i, &error)) |
609 | fail_mirror(ms->mirror + i, DM_RAID1_WRITE_ERROR); | 618 | fail_mirror(ms->mirror + i, DM_RAID1_WRITE_ERROR); |