aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2018-10-18 04:37:46 -0400
committerShaohua Li <shli@fb.com>2018-10-18 12:40:01 -0400
commitcbce6863b6d04f6eac6b144bcfaaf11a189d6533 (patch)
treeb2e04e66efd2ff10406e86b975a944fffda18bae /drivers/md
parentca1e98e04a8d6cefbe8ad138df806434de6de7f3 (diff)
md-cluster/bitmap: don't call md_bitmap_sync_with_cluster during reshaping stage
When reshape is happening in one node, other nodes could receive lots of RESYNCING messages, so md_bitmap_sync_with_cluster is called. Since the resyncing window is typically small in these RESYNCING messages, so WARN is always triggered, so we should not call the func when reshape is happening. Reviewed-by: NeilBrown <neilb@suse.com> Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md-cluster.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index ca4a35f8bad8..792e0218a42f 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -457,12 +457,13 @@ static void remove_suspend_info(struct mddev *mddev, int slot)
457 mddev->pers->quiesce(mddev, 0); 457 mddev->pers->quiesce(mddev, 0);
458} 458}
459 459
460
461static void process_suspend_info(struct mddev *mddev, 460static void process_suspend_info(struct mddev *mddev,
462 int slot, sector_t lo, sector_t hi) 461 int slot, sector_t lo, sector_t hi)
463{ 462{
464 struct md_cluster_info *cinfo = mddev->cluster_info; 463 struct md_cluster_info *cinfo = mddev->cluster_info;
465 struct suspend_info *s; 464 struct suspend_info *s;
465 struct mdp_superblock_1 *sb = NULL;
466 struct md_rdev *rdev;
466 467
467 if (!hi) { 468 if (!hi) {
468 /* 469 /*
@@ -476,6 +477,12 @@ static void process_suspend_info(struct mddev *mddev,
476 return; 477 return;
477 } 478 }
478 479
480 rdev_for_each(rdev, mddev)
481 if (rdev->raid_disk > -1 && !test_bit(Faulty, &rdev->flags)) {
482 sb = page_address(rdev->sb_page);
483 break;
484 }
485
479 /* 486 /*
480 * The bitmaps are not same for different nodes 487 * The bitmaps are not same for different nodes
481 * if RESYNCING is happening in one node, then 488 * if RESYNCING is happening in one node, then
@@ -488,12 +495,18 @@ static void process_suspend_info(struct mddev *mddev,
488 * sync_low/hi is used to record the region which 495 * sync_low/hi is used to record the region which
489 * arrived in the previous RESYNCING message, 496 * arrived in the previous RESYNCING message,
490 * 497 *
491 * Call bitmap_sync_with_cluster to clear 498 * Call md_bitmap_sync_with_cluster to clear NEEDED_MASK
492 * NEEDED_MASK and set RESYNC_MASK since 499 * and set RESYNC_MASK since resync thread is running
493 * resync thread is running in another node, 500 * in another node, so we don't need to do the resync
494 * so we don't need to do the resync again 501 * again with the same section.
495 * with the same section */ 502 *
496 md_bitmap_sync_with_cluster(mddev, cinfo->sync_low, cinfo->sync_hi, lo, hi); 503 * Skip md_bitmap_sync_with_cluster in case reshape
504 * happening, because reshaping region is small and
505 * we don't want to trigger lots of WARN.
506 */
507 if (sb && !(le32_to_cpu(sb->feature_map) & MD_FEATURE_RESHAPE_ACTIVE))
508 md_bitmap_sync_with_cluster(mddev, cinfo->sync_low,
509 cinfo->sync_hi, lo, hi);
497 cinfo->sync_low = lo; 510 cinfo->sync_low = lo;
498 cinfo->sync_hi = hi; 511 cinfo->sync_hi = hi;
499 512