diff options
author | Rahul C S <rahulcs@redhat.com> | 2012-02-14 17:09:21 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-02-14 10:24:24 -0800 |
commit | 22d2abe742a67f1700f0f8f2a6449f3640826b27 (patch) | |
tree | 2c443c13a9e2b6546af66d3cfd2a855d7de60dc8 /xlators/mgmt/glusterd/src/glusterd-log-ops.c | |
parent | 38d73bdfc659dde4a2632da2da01c785b642c728 (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/mgmt/glusterd/src/glusterd-log-ops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-log-ops.c | 11 |
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 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; |