diff options
| author | Anuradha <atalur@redhat.com> | 2015-01-05 16:37:07 +0530 |
|---|---|---|
| committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-01-06 02:04:49 -0800 |
| commit | 59ba78ae1461651e290ce72013786d828545d4c1 (patch) | |
| tree | 19bc7b37b3d2fff0cd2870acc8d1cd7e93d3f470 /xlators/cluster/afr/src/afr-self-heal-common.c | |
| parent | 50952cda111c84c966dc0427bbdb618e31bf8d78 (diff) | |
afr : glfs-heal implementation
Backport of http://review.gluster.org/6529
and http://review.gluster.org/9119
Change-Id: Ie420efcb399b5119c61f448b421979c228b27b15
BUG: 1173528
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/9335
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
| -rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 14a514beffa..6198d4cf72c 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -932,13 +932,14 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this, if (replies[i].op_ret == -1) continue; - if (afr_is_data_set (this, replies[i].xdata)) + if (data_selfheal && afr_is_data_set (this, replies[i].xdata)) *data_selfheal = _gf_true; - if (afr_is_metadata_set (this, replies[i].xdata)) + if (metadata_selfheal && + afr_is_metadata_set (this, replies[i].xdata)) *metadata_selfheal = _gf_true; - if (afr_is_entry_set (this, replies[i].xdata)) + if (entry_selfheal && afr_is_entry_set (this, replies[i].xdata)) *entry_selfheal = _gf_true; valid_cnt ++; @@ -967,7 +968,8 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this, priv->children[i]->name, uuid_utoa (replies[i].poststat.ia_gfid)); - *metadata_selfheal = _gf_true; + if (metadata_selfheal) + *metadata_selfheal = _gf_true; } if (!IA_EQUAL (first, replies[i].poststat, gid)) { @@ -978,7 +980,8 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this, priv->children[i]->name, uuid_utoa (replies[i].poststat.ia_gfid)); - *metadata_selfheal = _gf_true; + if (metadata_selfheal) + *metadata_selfheal = _gf_true; } if (!IA_EQUAL (first, replies[i].poststat, prot)) { @@ -989,7 +992,8 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this, priv->children[i]->name, uuid_utoa (replies[i].poststat.ia_gfid)); - *metadata_selfheal = _gf_true; + if (metadata_selfheal) + *metadata_selfheal = _gf_true; } if (IA_ISREG(first.ia_type) && @@ -1001,11 +1005,12 @@ afr_selfheal_unlocked_inspect (call_frame_t *frame, xlator_t *this, priv->children[i]->name, uuid_utoa (replies[i].poststat.ia_gfid)); - *data_selfheal = _gf_true; + if (data_selfheal) + *data_selfheal = _gf_true; } } - if (valid_cnt > 0) { + if (valid_cnt > 0 && link_inode) { *link_inode = afr_inode_link (inode, &first); if (!*link_inode) { ret = -EINVAL; |
