diff options
author | Rajesh Amaravathi <rajesh@gluster.com> | 2011-09-27 16:25:58 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-29 09:16:13 -0700 |
commit | f3a6752cc455676d6e1f946b513636d991825da8 (patch) | |
tree | 873f5b0baa7de5b9471192873fc531393bd92009 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 6d1e6a5b7c447d612684de1a75b6701b1f628fb6 (diff) |
glusterd: allow non-related directories with same prefix
Earlier, using two directories with names like /test and /test1
failed volume creation. This patch sees that the next character is
checked to be '/' to conclude that they are recursive.
Eg: /test and /test2 succeed, while /test and /test/alpha does not.
Change-Id: Idee1e15b7e0a0d0965d1aea910b52f1da286d64b
BUG: 3645
Reviewed-on: http://review.gluster.com/511
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index e27d2209f44..d2305df1ee3 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -756,14 +756,19 @@ glusterd_volume_brickinfo_get (uuid_t uuid, char *hostname, char *path, gf_log (THIS->name, GF_LOG_ERROR, "given path %s lies within brick %s", path, brickiter->path); + *brickinfo = brickiter; + ret = 0; + break; } else if (path[smaller_path] == '/') { gf_log (THIS->name, GF_LOG_ERROR, "brick %s is a part of %s", brickiter->path, path); + *brickinfo = brickiter; + ret = 0; + break; + } else { + ret = -1; } - *brickinfo = brickiter; - ret = 0; - break; } } |