summaryrefslogtreecommitdiffstats
path: root/xlators/features/barrier/src
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2014-04-30 11:12:40 +0530
committerKaushal M <kaushal@redhat.com>2014-05-12 04:37:03 -0700
commite64dd0a358e7a7b4c0da86a6b17adf6f125c00d5 (patch)
tree36db6dd9895651c827f36f3cb7943426c2672fe2 /xlators/features/barrier/src
parent4f905163211f8d439c6e102d3ffd1bffb34f5c26 (diff)
glusterd : barrier enable/disable should fail if already enabled/disabled
In barrier notify function, if we fail to set the barrier option execution goes to default_notify which returns 0 and command returns success. Fix : We need not call the default_notify function when handling GF_EVENT_TRANSLATOR_OP in barrier xlator's notify. Change-Id: Ia2c361b43cca7791c29829d69dcd6fc7923102f6 BUG: 1092841 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/7609 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/features/barrier/src')
-rw-r--r--xlators/features/barrier/src/barrier.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/features/barrier/src/barrier.c b/xlators/features/barrier/src/barrier.c
index a6867f6f45f..74973499d56 100644
--- a/xlators/features/barrier/src/barrier.c
+++ b/xlators/features/barrier/src/barrier.c
@@ -351,8 +351,13 @@ notify (xlator_t *this, int event, void *data, ...)
case GF_EVENT_TRANSLATOR_OP:
{
dict = data;
- GF_OPTION_RECONF ("barrier", barrier_enabled, dict,
- bool, out);
+ barrier_enabled = dict_get_str_boolean (dict, "barrier", -1);
+
+ if (barrier_enabled == -1) {
+ gf_log (this->name, GF_LOG_ERROR, "Could not fetch "
+ " barrier key from the dictionary.");
+ goto out;
+ }
LOCK (&priv->lock);
{
@@ -388,7 +393,8 @@ unlock:
if (!list_empty (&queue))
barrier_dequeue_all (this, &queue);
- // missing break is intentional
+
+ break;
}
default:
{