aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 78ac7dc853c7..b7cd32e7f29e 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -672,20 +672,23 @@ get_active_stripe(struct r5conf *conf, sector_t sector,
672 *(conf->hash_locks + hash)); 672 *(conf->hash_locks + hash));
673 sh = __find_stripe(conf, sector, conf->generation - previous); 673 sh = __find_stripe(conf, sector, conf->generation - previous);
674 if (!sh) { 674 if (!sh) {
675 if (!conf->inactive_blocked) 675 if (!test_bit(R5_INACTIVE_BLOCKED, &conf->cache_state))
676 sh = get_free_stripe(conf, hash); 676 sh = get_free_stripe(conf, hash);
677 if (noblock && sh == NULL) 677 if (noblock && sh == NULL)
678 break; 678 break;
679 if (!sh) { 679 if (!sh) {
680 conf->inactive_blocked = 1; 680 set_bit(R5_INACTIVE_BLOCKED,
681 &conf->cache_state);
681 wait_event_lock_irq( 682 wait_event_lock_irq(
682 conf->wait_for_stripe, 683 conf->wait_for_stripe,
683 !list_empty(conf->inactive_list + hash) && 684 !list_empty(conf->inactive_list + hash) &&
684 (atomic_read(&conf->active_stripes) 685 (atomic_read(&conf->active_stripes)
685 < (conf->max_nr_stripes * 3 / 4) 686 < (conf->max_nr_stripes * 3 / 4)
686 || !conf->inactive_blocked), 687 || !test_bit(R5_INACTIVE_BLOCKED,
688 &conf->cache_state)),
687 *(conf->hash_locks + hash)); 689 *(conf->hash_locks + hash));
688 conf->inactive_blocked = 0; 690 clear_bit(R5_INACTIVE_BLOCKED,
691 &conf->cache_state);
689 } else { 692 } else {
690 init_stripe(sh, sector, previous); 693 init_stripe(sh, sector, previous);
691 atomic_inc(&sh->count); 694 atomic_inc(&sh->count);
@@ -4602,7 +4605,7 @@ static int raid5_congested(struct mddev *mddev, int bits)
4602 * how busy the stripe_cache is 4605 * how busy the stripe_cache is
4603 */ 4606 */
4604 4607
4605 if (conf->inactive_blocked) 4608 if (test_bit(R5_INACTIVE_BLOCKED, &conf->cache_state))
4606 return 1; 4609 return 1;
4607 if (conf->quiesce) 4610 if (conf->quiesce)
4608 return 1; 4611 return 1;