summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorGoldwyn Rodrigues <rgoldwyn@suse.com>2015-12-21 10:50:59 +1100
committerNeilBrown <neilb@suse.com>2016-01-06 11:38:27 +1100
commitac277c6a8a39bc50f891a3477625330c276bd7f5 (patch)
tree767ee803cc2e14dddf8607554b14b6b6e60748c4 /drivers/md
parentb46020aa3a8a0f9c7324fe0af4aec4227f947a10 (diff)
downloadlinux-ac277c6a8a39bc50f891a3477625330c276bd7f5.tar.gz
linux-ac277c6a8a39bc50f891a3477625330c276bd7f5.tar.bz2
linux-ac277c6a8a39bc50f891a3477625330c276bd7f5.zip
md-cluster: Avoid the resync ping-pong
If a RESYNCING message with (0,0) has been sent before, do not send it again. This avoids a resync ping pong between the nodes. We read the bitmap lockresource's LVB to figure out the previous value of the RESYNCING message. Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md-cluster.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
index d6a1126d85ce..e57bbfed1638 100644
--- a/drivers/md/md-cluster.c
+++ b/drivers/md/md-cluster.c
@@ -882,8 +882,16 @@ static int resync_start(struct mddev *mddev)
static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi)
{
struct md_cluster_info *cinfo = mddev->cluster_info;
+ struct resync_info ri;
struct cluster_msg cmsg = {0};
+ /* do not send zero again, if we have sent before */
+ if (hi == 0) {
+ memcpy(&ri, cinfo->bitmap_lockres->lksb.sb_lvbptr, sizeof(struct resync_info));
+ if (le64_to_cpu(ri.hi) == 0)
+ return 0;
+ }
+
add_resync_info(cinfo->bitmap_lockres, lo, hi);
/* Re-acquire the lock to refresh LVB */
dlm_lock_sync(cinfo->bitmap_lockres, DLM_LOCK_PW);