summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-12-15 08:05:04 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2014-10-15 01:22:02 -0700
commit7e8eefca2caaaa61e1b31b747384f660c595d9c9 (patch)
treea6e862f2caad4097a41dd8b260a2333e90db3b4a /xlators/cluster/afr/src/afr-self-heal-common.c
parent7808d4b7892ccd80bcabb1253ee359a64c51c612 (diff)
heal: glfs-heal implementation
Thanks a lot to Niels for helping me to get build stuff right. Change-Id: I634f24d90cd856ceab3cc0c6e9a91003f443403e BUG: 1147462 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/6529 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c21
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;