aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2014-06-07 03:39:37 -0400
committerGoldwyn Rodrigues <rgoldwyn@suse.com>2015-02-23 10:59:07 -0500
commit589a1c491621ab81a1955d17d634636522c1b4c1 (patch)
treeb476b0701562e54da42f4664f4ee81e8bb39f563 /drivers/md/raid1.c
parente59721ccdc65dd4fbd8f311a063ecc8f6232dbcc (diff)
Suspend writes in RAID1 if within range
If there is a resync going on, all nodes must suspend writes to the range. This is recorded in the suspend_info/suspend_list. If there is an I/O within the ranges of any of the suspend_info, should_suspend will return 1. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4153da5d4011..3aa58ab5b1fd 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1101,8 +1101,10 @@ static void make_request(struct mddev *mddev, struct bio * bio)
1101 md_write_start(mddev, bio); /* wait on superblock update early */ 1101 md_write_start(mddev, bio); /* wait on superblock update early */
1102 1102
1103 if (bio_data_dir(bio) == WRITE && 1103 if (bio_data_dir(bio) == WRITE &&
1104 bio_end_sector(bio) > mddev->suspend_lo && 1104 ((bio_end_sector(bio) > mddev->suspend_lo &&
1105 bio->bi_iter.bi_sector < mddev->suspend_hi) { 1105 bio->bi_iter.bi_sector < mddev->suspend_hi) ||
1106 (mddev_is_clustered(mddev) &&
1107 md_cluster_ops->area_resyncing(mddev, bio->bi_iter.bi_sector, bio_end_sector(bio))))) {
1106 /* As the suspend_* range is controlled by 1108 /* As the suspend_* range is controlled by
1107 * userspace, we want an interruptible 1109 * userspace, we want an interruptible
1108 * wait. 1110 * wait.
@@ -1113,7 +1115,10 @@ static void make_request(struct mddev *mddev, struct bio * bio)
1113 prepare_to_wait(&conf->wait_barrier, 1115 prepare_to_wait(&conf->wait_barrier,
1114 &w, TASK_INTERRUPTIBLE); 1116 &w, TASK_INTERRUPTIBLE);
1115 if (bio_end_sector(bio) <= mddev->suspend_lo || 1117 if (bio_end_sector(bio) <= mddev->suspend_lo ||
1116 bio->bi_iter.bi_sector >= mddev->suspend_hi) 1118 bio->bi_iter.bi_sector >= mddev->suspend_hi ||
1119 (mddev_is_clustered(mddev) &&
1120 !md_cluster_ops->area_resyncing(mddev,
1121 bio->bi_iter.bi_sector, bio_end_sector(bio))))
1117 break; 1122 break;
1118 schedule(); 1123 schedule();
1119 } 1124 }