diff options
author | Anuradha Talur <atalur@redhat.com> | 2015-09-11 18:43:36 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-09-15 19:22:58 -0700 |
commit | 57dfa97d4f84d426969591d3c0c674bdd54de450 (patch) | |
tree | 4113e9d980021daee61df39f3c53338a832f74cc /xlators/cluster/afr/src/afr-common.c | |
parent | 2e65b7aa6fe8fd03c1bea83d8b1d81ed4a774207 (diff) |
afr : get split-brain-status in a synctask
Backport of: http://review.gluster.org/#/c/12163/
On executing `getfattr -n replica.split-brain-status <file>` on mount,
there is a possibility that the mount hangs. To avoid this hang,
fetch the split-brain-status of a file in synctask.
>Change-Id: I87b781419ffc63248f915325b845e3233143d385
>BUG: 1262345
>Signed-off-by: Anuradha Talur <atalur@redhat.com>
Change-Id: I9f4f4b54e108d3a0017264353b8272e072170c16
BUG: 1262547
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/12166
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 2eb3946ab7c..1c652f41e88 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -4588,8 +4588,7 @@ out: } int -afr_get_heal_info (call_frame_t *frame, xlator_t *this, loc_t *loc, - dict_t *xdata) +afr_get_heal_info (call_frame_t *frame, xlator_t *this, loc_t *loc) { gf_boolean_t data_selfheal = _gf_false; gf_boolean_t metadata_selfheal = _gf_false; @@ -4714,7 +4713,14 @@ out: } int -afr_get_split_brain_status (call_frame_t *frame, xlator_t *this, loc_t *loc) +afr_get_split_brain_status_cbk (int ret, call_frame_t *frame, void *opaque) +{ + GF_FREE (opaque); + return 0; +} + +int +afr_get_split_brain_status (void *opaque) { gf_boolean_t d_spb = _gf_false; gf_boolean_t m_spb = _gf_false; @@ -4727,7 +4733,15 @@ afr_get_split_brain_status (call_frame_t *frame, xlator_t *this, loc_t *loc) inode_t *inode = NULL; afr_private_t *priv = NULL; xlator_t **children = NULL; - + call_frame_t *frame = NULL; + xlator_t *this = NULL; + loc_t *loc = NULL; + afr_spb_status_t *data = NULL; + + data = opaque; + frame = data->frame; + this = frame->this; + loc = data->loc; priv = this->private; children = priv->children; @@ -4777,14 +4791,20 @@ afr_get_split_brain_status (call_frame_t *frame, xlator_t *this, loc_t *loc) goto out; } ret = dict_set_dynstr (dict, GF_AFR_SBRAIN_STATUS, status); - if (ret) + if (ret) { + op_errno = -ret; + ret = -1; goto out; + } } else { ret = dict_set_str (dict, GF_AFR_SBRAIN_STATUS, "The file is not under data or" " metadata split-brain"); - if (ret) + if (ret) { + op_errno = -ret; + ret = -1; goto out; + } } ret = 0; |