lkml.org 
[lkml]   [2015]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.12 164/175] dm mirror: do not degrade the mirror on discard error
    Date
    From: Mikulas Patocka <mpatocka@redhat.com>

    3.12-stable review patch. If anyone has any objections, please let me know.

    ===============

    commit f2ed51ac64611d717d1917820a01930174c2f236 upstream.

    It may be possible that a device claims discard support but it rejects
    discards with -EOPNOTSUPP. It happens when using loopback on ext2/ext3
    filesystem driven by the ext4 driver. It may also happen if the
    underlying devices are moved from one disk on another.

    If discard error happens, we reject the bio with -EOPNOTSUPP, but we do
    not degrade the array.

    This patch fixes failed test shell/lvconvert-repair-transient.sh in the
    lvm2 testsuite if the testsuite is extracted on an ext2 or ext3
    filesystem and it is being driven by the ext4 driver.

    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Mike Snitzer <snitzer@redhat.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    ---
    drivers/md/dm-raid1.c | 9 +++++++++
    1 file changed, 9 insertions(+)

    diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
    index 9584443c5614..9388c3654f0a 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)
    return;
    }

    + /*
    + * If the bio is discard, return an error, but do not
    + * degrade the array.
    + */
    + if (bio->bi_rw & REQ_DISCARD) {
    + bio_endio(bio, -EOPNOTSUPP);
    + return;
    + }
    +
    for (i = 0; i < ms->nr_mirrors; i++)
    if (test_bit(i, &error))
    fail_mirror(ms->mirror + i, DM_RAID1_WRITE_ERROR);
    --
    2.3.0


    \
     
     \ /
      Last update: 2015-03-17 10:01    [W:2.538 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site