aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 038f5eb299ce..cc9d337a1ed3 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1286,27 +1286,15 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
1286 int first_clone; 1286 int first_clone;
1287 int max_sectors; 1287 int max_sectors;
1288 1288
1289 /*
1290 * Register the new request and wait if the reconstruction
1291 * thread has put up a bar for new requests.
1292 * Continue immediately if no resync is active currently.
1293 */
1294
1295
1296 if (mddev_is_clustered(mddev) && 1289 if (mddev_is_clustered(mddev) &&
1297 md_cluster_ops->area_resyncing(mddev, WRITE, 1290 md_cluster_ops->area_resyncing(mddev, WRITE,
1298 bio->bi_iter.bi_sector, bio_end_sector(bio))) { 1291 bio->bi_iter.bi_sector, bio_end_sector(bio))) {
1299 1292
1300 /*
1301 * As the suspend_* range is controlled by userspace, we want
1302 * an interruptible wait.
1303 */
1304 DEFINE_WAIT(w); 1293 DEFINE_WAIT(w);
1305 for (;;) { 1294 for (;;) {
1306 prepare_to_wait(&conf->wait_barrier, 1295 prepare_to_wait(&conf->wait_barrier,
1307 &w, TASK_IDLE); 1296 &w, TASK_IDLE);
1308 if (!mddev_is_clustered(mddev) || 1297 if (!md_cluster_ops->area_resyncing(mddev, WRITE,
1309 !md_cluster_ops->area_resyncing(mddev, WRITE,
1310 bio->bi_iter.bi_sector, 1298 bio->bi_iter.bi_sector,
1311 bio_end_sector(bio))) 1299 bio_end_sector(bio)))
1312 break; 1300 break;
@@ -1314,6 +1302,12 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
1314 } 1302 }
1315 finish_wait(&conf->wait_barrier, &w); 1303 finish_wait(&conf->wait_barrier, &w);
1316 } 1304 }
1305
1306 /*
1307 * Register the new request and wait if the reconstruction
1308 * thread has put up a bar for new requests.
1309 * Continue immediately if no resync is active currently.
1310 */
1317 wait_barrier(conf, bio->bi_iter.bi_sector); 1311 wait_barrier(conf, bio->bi_iter.bi_sector);
1318 1312
1319 r1_bio = alloc_r1bio(mddev, bio); 1313 r1_bio = alloc_r1bio(mddev, bio);