summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRahul C S <rahulcs@redhat.com>2012-02-14 17:09:21 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-14 10:24:24 -0800
commit22d2abe742a67f1700f0f8f2a6449f3640826b27 (patch)
tree2c443c13a9e2b6546af66d3cfd2a855d7de60dc8 /xlators
parent38d73bdfc659dde4a2632da2da01c785b642c728 (diff)
Allows Successful log rotation when no bricks are specified.
log rotate must happen for all the bricks if no specific brick path is given as an argument for the command. Change-Id: I39e55883fd301bedffae996384a8284119011951 BUG: 765578 Signed-off-by: Rahul C S <rahulcs@redhat.com> Reviewed-on: http://review.gluster.com/2748 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-log-ops.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-log-ops.c b/xlators/mgmt/glusterd/src/glusterd-log-ops.c
index ec8889670..93e037f87 100644
--- a/xlators/mgmt/glusterd/src/glusterd-log-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-log-ops.c
@@ -135,8 +135,12 @@ glusterd_op_stage_log_rotate (dict_t *dict, char **op_errstr)
}
ret = dict_get_str (dict, "brick", &brick);
- if (ret)
+ /* If no brick is specified, do log-rotate for
+ all the bricks in the volume */
+ if (ret) {
+ ret = 0;
goto out;
+ }
if (strchr (brick, ':')) {
ret = glusterd_volume_brickinfo_get_by_brick (brick, volinfo, NULL,
@@ -193,8 +197,10 @@ glusterd_op_log_rotate (dict_t *dict)
}
ret = dict_get_str (dict, "brick", &brick);
+ /* If no brick is specified, do log-rotate for
+ all the bricks in the volume */
if (ret)
- goto out;
+ goto cont;
if (!strchr (brick, ':'))
brick = NULL;
@@ -207,6 +213,7 @@ glusterd_op_log_rotate (dict_t *dict)
}
}
+cont:
ret = glusterd_volinfo_find (volname, &volinfo);
if (ret)
goto out;