From 22d2abe742a67f1700f0f8f2a6449f3640826b27 Mon Sep 17 00:00:00 2001 From: Rahul C S Date: Tue, 14 Feb 2012 17:09:21 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/2748 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/mgmt/glusterd/src/glusterd-log-ops.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-log-ops.c b/xlators/mgmt/glusterd/src/glusterd-log-ops.c index ec8889670ba..93e037f8747 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; -- cgit