aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index a88aeb5198c7..84718383124d 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -799,7 +799,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
799 int i; 799 int i;
800 int chunk_sects = conf->chunk_mask + 1; 800 int chunk_sects = conf->chunk_mask + 1;
801 const int rw = bio_data_dir(bio); 801 const int rw = bio_data_dir(bio);
802 const bool do_sync = (bio->bi_rw & REQ_SYNC); 802 const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
803 struct bio_list bl; 803 struct bio_list bl;
804 unsigned long flags; 804 unsigned long flags;
805 mdk_rdev_t *blocked_rdev; 805 mdk_rdev_t *blocked_rdev;
@@ -1116,6 +1116,8 @@ static int raid10_spare_active(mddev_t *mddev)
1116 int i; 1116 int i;
1117 conf_t *conf = mddev->private; 1117 conf_t *conf = mddev->private;
1118 mirror_info_t *tmp; 1118 mirror_info_t *tmp;
1119 int count = 0;
1120 unsigned long flags;
1119 1121
1120 /* 1122 /*
1121 * Find all non-in_sync disks within the RAID10 configuration 1123 * Find all non-in_sync disks within the RAID10 configuration
@@ -1126,15 +1128,16 @@ static int raid10_spare_active(mddev_t *mddev)
1126 if (tmp->rdev 1128 if (tmp->rdev
1127 && !test_bit(Faulty, &tmp->rdev->flags) 1129 && !test_bit(Faulty, &tmp->rdev->flags)
1128 && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { 1130 && !test_and_set_bit(In_sync, &tmp->rdev->flags)) {
1129 unsigned long flags; 1131 count++;
1130 spin_lock_irqsave(&conf->device_lock, flags); 1132 sysfs_notify_dirent(tmp->rdev->sysfs_state);
1131 mddev->degraded--;
1132 spin_unlock_irqrestore(&conf->device_lock, flags);
1133 } 1133 }
1134 } 1134 }
1135 spin_lock_irqsave(&conf->device_lock, flags);
1136 mddev->degraded -= count;
1137 spin_unlock_irqrestore(&conf->device_lock, flags);
1135 1138
1136 print_conf(conf); 1139 print_conf(conf);
1137 return 0; 1140 return count;
1138} 1141}
1139 1142
1140 1143
@@ -1734,7 +1737,7 @@ static void raid10d(mddev_t *mddev)
1734 raid_end_bio_io(r10_bio); 1737 raid_end_bio_io(r10_bio);
1735 bio_put(bio); 1738 bio_put(bio);
1736 } else { 1739 } else {
1737 const bool do_sync = (r10_bio->master_bio->bi_rw & REQ_SYNC); 1740 const unsigned long do_sync = (r10_bio->master_bio->bi_rw & REQ_SYNC);
1738 bio_put(bio); 1741 bio_put(bio);
1739 rdev = conf->mirrors[mirror].rdev; 1742 rdev = conf->mirrors[mirror].rdev;
1740 if (printk_ratelimit()) 1743 if (printk_ratelimit())