linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] md-cluster: fix wrong condition check in raid1_write_request
@ 2017-09-29  1:16 Guoqing Jiang
  2017-09-29  1:16 ` [PATCH 2/2] md: clear THREAD_WAKEUP flag in mddev_trylock Guoqing Jiang
  2017-09-29 17:54 ` [PATCH 1/2] md-cluster: fix wrong condition check in raid1_write_request Shaohua Li
  0 siblings, 2 replies; 4+ messages in thread
From: Guoqing Jiang @ 2017-09-29  1:16 UTC (permalink / raw)
  To: linux-raid; +Cc: shli, Guoqing Jiang

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>
---
 drivers/md/raid1.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index f3f3e40..35264ad 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);
-- 
2.6.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-29 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-29  1:16 [PATCH 1/2] md-cluster: fix wrong condition check in raid1_write_request Guoqing Jiang
2017-09-29  1:16 ` [PATCH 2/2] md: clear THREAD_WAKEUP flag in mddev_trylock Guoqing Jiang
2017-09-29 18:00   ` Shaohua Li
2017-09-29 17:54 ` [PATCH 1/2] md-cluster: fix wrong condition check in raid1_write_request Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).