~ubuntu-branches/ubuntu/trusty/linux-ti-omap4/trusty

« back to all changes in this revision

Viewing changes to drivers/md/raid10.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2013-07-11 18:35:20 UTC
  • Revision ID: package-import@ubuntu.com-20130711183520-htnf1x4y5r11hndr
Tags: 3.5.0-229.42
* Release Tracking Bug
  - LP: #1199276

[ Paolo Pisati ]

* [Config] CONFIG_ATH9K_LEGACY_RATE_CONTROL is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
461
461
                sector_t first_bad;
462
462
                int bad_sectors;
463
463
 
464
 
                set_bit(R10BIO_Uptodate, &r10_bio->state);
 
464
                /*
 
465
                 * Do not set R10BIO_Uptodate if the current device is
 
466
                 * rebuilding or Faulty. This is because we cannot use
 
467
                 * such device for properly reading the data back (we could
 
468
                 * potentially use it, if the current write would have felt
 
469
                 * before rdev->recovery_offset, but for simplicity we don't
 
470
                 * check this here.
 
471
                 */
 
472
                if (test_bit(In_sync, &rdev->flags) &&
 
473
                    !test_bit(Faulty, &rdev->flags))
 
474
                        set_bit(R10BIO_Uptodate, &r10_bio->state);
465
475
 
466
476
                /* Maybe we can clear some bad blocks. */
467
477
                if (is_badblock(rdev,
985
995
        wake_up(&conf->wait_barrier);
986
996
}
987
997
 
988
 
static void freeze_array(struct r10conf *conf)
 
998
static void freeze_array(struct r10conf *conf, int extra)
989
999
{
990
1000
        /* stop syncio and normal IO and wait for everything to
991
1001
         * go quiet.
992
1002
         * We increment barrier and nr_waiting, and then
993
 
         * wait until nr_pending match nr_queued+1
 
1003
         * wait until nr_pending match nr_queued+extra
994
1004
         * This is called in the context of one normal IO request
995
1005
         * that has failed. Thus any sync request that might be pending
996
1006
         * will be blocked by nr_pending, and we need to wait for
997
1007
         * pending IO requests to complete or be queued for re-try.
998
 
         * Thus the number queued (nr_queued) plus this request (1)
 
1008
         * Thus the number queued (nr_queued) plus this request (extra)
999
1009
         * must match the number of pending IOs (nr_pending) before
1000
1010
         * we continue.
1001
1011
         */
1003
1013
        conf->barrier++;
1004
1014
        conf->nr_waiting++;
1005
1015
        wait_event_lock_irq(conf->wait_barrier,
1006
 
                            conf->nr_pending == conf->nr_queued+1,
 
1016
                            conf->nr_pending == conf->nr_queued+extra,
1007
1017
                            conf->resync_lock,
1008
1018
                            flush_pending_writes(conf));
1009
1019
 
1705
1715
                 * we wait for all outstanding requests to complete.
1706
1716
                 */
1707
1717
                synchronize_sched();
1708
 
                raise_barrier(conf, 0);
1709
 
                lower_barrier(conf);
 
1718
                freeze_array(conf, 0);
 
1719
                unfreeze_array(conf);
1710
1720
                clear_bit(Unmerged, &rdev->flags);
1711
1721
        }
1712
1722
        md_integrity_add_rdev(rdev, mddev);
2499
2509
        r10_bio->devs[slot].bio = NULL;
2500
2510
 
2501
2511
        if (mddev->ro == 0) {
2502
 
                freeze_array(conf);
 
2512
                freeze_array(conf, 1);
2503
2513
                fix_read_error(conf, mddev, r10_bio);
2504
2514
                unfreeze_array(conf);
2505
2515
        } else