diff options
author | Krishnan Parthasarathi <kp@gluster.com> | 2012-05-25 15:02:47 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-05-27 22:37:38 -0700 |
commit | d497922a725da0690e5c5c75911e59d30c5d53a1 (patch) | |
tree | 8dee851ea98a9b5e3f4df794f355478acea6ba65 /xlators | |
parent | 3d653908554dc92af6b7414df4083bee2b9e039f (diff) |
glusterd: Cherry-picked e44ac01b08c3ee from master branch
Fix volume create
Improve Krishnan Parthasarathi's patch, which fixed situation where
a brick mount point did not had EA enabled. This fixes an incorrect
assumption that dirname(3) returns the same address it was given as
argument. GNU dirname(3) does it, BSD dirname(3) does not.
Also makes the code a bit easier to read.
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Change-Id: Ie5106b0ee7bda126666cd0ec9c827c895ec035c9
BUG: 812214
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3441
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index ab72d85149a..b75fad18347 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -4385,17 +4385,27 @@ glusterd_is_uuid_present (char *path, char *xattr, gf_boolean_t *present) goto out; ret = sys_lgetxattr (path, xattr, &uid, 16); - if (ret < 0 && errno != ENODATA) { - goto out; - } else if (ret >= 0) { + if (ret >= 0) { *present = _gf_true; - - } else { - *present = _gf_false; + ret = 0; + goto out; } - ret = 0; + switch (errno) { +#if defined(ENODATA) + case ENODATA: /* FALLTHROUGH */ +#endif +#if defined(ENOATTR) && (ENOATTR != ENODATA) + case ENOATTR: /* FALLTHROUGH */ +#endif + case ENOTSUP: + *present = _gf_false; + ret = 0; + break; + default: + break; + } out: return ret; } @@ -4430,7 +4440,7 @@ glusterd_is_path_in_use (char *path, gf_boolean_t *in_use, char **op_errstr) if (used) break; - curdir = dirname (dir); + curdir = dirname (curdir); if (!strcmp (curdir, ".")) goto out; |