summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-10-30 12:11:36 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-10-30 21:23:18 -0700
commit961d5fb6025f4901d63be8cfc8062bd8e2093021 (patch)
tree92a17083475cb3e958875c563f2f51a523ad083a /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent586000144be8919a234939ad43b04394d5f2636e (diff)
mgmt/glusterd: Honor log filename set during add-brick
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2042 (No volume log files found in the specified directory for the newly added bricks) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2042
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 93f6fc188..b20f6bd6e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -3559,9 +3559,20 @@ glusterd_op_log_filename (gd1_mgmt_stage_op_req *req)
if (ret)
goto out;
- if (!strchr (brick, ':'))
+ ret = glusterd_volinfo_find (volname, &volinfo);
+ if (ret)
+ goto out;
+
+ if (!strchr (brick, ':')) {
brick = NULL;
- else {
+ ret = stat (path, &stbuf);
+ if (ret || !S_ISDIR (stbuf.st_mode)) {
+ ret = -1;
+ gf_log ("", GF_LOG_ERROR, "not a directory");
+ goto out;
+ }
+ volinfo->logdir = gf_strdup (path);
+ } else {
ret = glusterd_brickinfo_from_brick (brick, &tmpbrkinfo);
if (ret) {
gf_log ("glusterd", GF_LOG_ERROR,
@@ -3570,9 +3581,6 @@ glusterd_op_log_filename (gd1_mgmt_stage_op_req *req)
}
}
- ret = glusterd_volinfo_find (volname, &volinfo);
- if (ret)
- goto out;
ret = -1;
list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {