summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-09-29 03:16:43 +0200
committerShaohua Li <shli@fb.com>2017-10-17 04:06:33 +0200
commit385f4d7f946b08f36f68b0a28e95a319925b6b62 (patch)
treec1422710580342a1a469842c4dcebf6bfba75965 /drivers/md/raid1.c
parentmd/bitmap: revert a patch (diff)
downloadlinux-385f4d7f946b08f36f68b0a28e95a319925b6b62.tar.xz
linux-385f4d7f946b08f36f68b0a28e95a319925b6b62.zip
md-cluster: fix wrong condition check in raid1_write_request
The check used here is to avoid conflict between write and resync, however we used the wrong logic, it should be the inverse of the checking inside "if". Fixes: 589a1c4 ("Suspend writes in RAID1 if within range") Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to '')
-rw-r--r--drivers/md/raid1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index f3f3e40dc9d8..35264ad0ec70 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1325,12 +1325,12 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
sigset_t full, old;
prepare_to_wait(&conf->wait_barrier,
&w, TASK_INTERRUPTIBLE);
- if (bio_end_sector(bio) <= mddev->suspend_lo ||
- bio->bi_iter.bi_sector >= mddev->suspend_hi ||
- (mddev_is_clustered(mddev) &&
+ if ((bio_end_sector(bio) <= mddev->suspend_lo ||
+ bio->bi_iter.bi_sector >= mddev->suspend_hi) &&
+ (!mddev_is_clustered(mddev) ||
!md_cluster_ops->area_resyncing(mddev, WRITE,
- bio->bi_iter.bi_sector,
- bio_end_sector(bio))))
+ bio->bi_iter.bi_sector,
+ bio_end_sector(bio))))
break;
sigfillset(&full);
sigprocmask(SIG_BLOCK, &full, &old);