md-cluster: make sure the node do not receive it's own msg
authorGuoqing Jiang <gqjiang@suse.com>
Mon, 12 Oct 2015 09:21:23 +0000 (17:21 +0800)
committerGoldwyn Rodrigues <rgoldwyn@suse.com>
Mon, 12 Oct 2015 16:58:14 +0000 (11:58 -0500)
During the past test, the node occasionally received the msg which is
sent from itself, this case should not happen in theory, but it is
better to avoid it in case something wrong happened.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
drivers/md/md-cluster.c

index ba80df923605e43bc464b1b4f8dc5ae1523c15ae..8bddd7882292597fe280e9e6fd757aa0b492a7bf 100644 (file)
@@ -462,6 +462,9 @@ static void process_readd_disk(struct mddev *mddev, struct cluster_msg *msg)
 
 static void process_recvd_msg(struct mddev *mddev, struct cluster_msg *msg)
 {
+       if (WARN(mddev->cluster_info->slot_number - 1 == le32_to_cpu(msg->slot),
+               "node %d received it's own msg\n", le32_to_cpu(msg->slot)))
+               return;
        switch (msg->type) {
        case METADATA_UPDATED:
                process_metadata_update(mddev, msg);