From 7e8eefca2caaaa61e1b31b747384f660c595d9c9 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Sun, 15 Dec 2013 08:05:04 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/6529 Reviewed-by: Krutika Dhananjay Tested-by: Gluster Build System --- xlators/cluster/afr/src/afr-self-heal-common.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c') 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; -- cgit