lkml.org 
[lkml]   [2013]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 049/103] md/raid10: fix bug which causes all RAID10 reshapes to move no data.
    Date
    3.10-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: NeilBrown <neilb@suse.de>

    commit 1376512065b23f39d5f9a160948f313397dde972 upstream.

    The recent comment:
    commit 7e83ccbecd608b971f340e951c9e84cd0343002f
    md/raid10: Allow skipping recovery when clean arrays are assembled

    Causes raid10 to skip a recovery in certain cases where it is safe to
    do so. Unfortunately it also causes a reshape to be skipped which is
    never safe. The result is that an attempt to reshape a RAID10 will
    appear to complete instantly, but no data will have been moves so the
    array will now contain garbage.
    (If nothing is written, you can recovery by simple performing the
    reverse reshape which will also complete instantly).

    Bug was introduced in 3.10, so this is suitable for 3.10-stable.

    Signed-off-by: NeilBrown <neilb@suse.de>
    Cc: Martin Wilck <mwilck@arcor.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/md/raid10.c | 9 ++++-----
    1 file changed, 4 insertions(+), 5 deletions(-)

    --- a/drivers/md/raid10.c
    +++ b/drivers/md/raid10.c
    @@ -2909,14 +2909,13 @@ static sector_t sync_request(struct mdde
    */
    if (mddev->bitmap == NULL &&
    mddev->recovery_cp == MaxSector &&
    + mddev->reshape_position == MaxSector &&
    + !test_bit(MD_RECOVERY_SYNC, &mddev->recovery) &&
    !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
    + !test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
    conf->fullsync == 0) {
    *skipped = 1;
    - max_sector = mddev->dev_sectors;
    - if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
    - test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
    - max_sector = mddev->resync_max_sectors;
    - return max_sector - sector_nr;
    + return mddev->dev_sectors - sector_nr;
    }

    skipped:



    \
     
     \ /
      Last update: 2013-07-24 01:41    [W:4.161 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site