summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-hooks.c
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2012-05-07 13:31:24 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-16 03:53:52 -0700
commitcb83c85511fc7fbfe34f97baebdda9d2bb309511 (patch)
tree3ed6a68637d6000a8d3a7326869fbf8a00415593 /xlators/mgmt/glusterd/src/glusterd-hooks.c
parent74fbeb2d1a997a0238aa15ab2dccc98764b667a2 (diff)
glusterd: Fixed glusterd_brick_create_path algo.
- check if any prefix of the brick path has "trusted.gfid" or "trusted.glusterfs.volume-id" set. - set trusted.glusterfs.volume-id on the bricks as soon as its induction into the volume is settled. Earlier, the setting of "volume-id" used to happen during the first run of the brick process, leaving of window for bricks part of one volume to be (ab)used by another volume inadvertently. - removed creation of brick directory (if missing), during start volume force. This is to avoid directory creation as part 'force'ful starting of volume and leave the responsibility with the user, who understands the 'availability' of the export directory (brick) better. Change-Id: I4237ec4ea7a4e38a7501027e7de7112edd67de8c BUG: 812214 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/3280 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-hooks.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-hooks.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-hooks.c b/xlators/mgmt/glusterd/src/glusterd-hooks.c
index 2afdb1625..ba428b0f3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-hooks.c
+++ b/xlators/mgmt/glusterd/src/glusterd-hooks.c
@@ -39,8 +39,6 @@
#include <fnmatch.h>
-extern int mkdir_if_missing (char *dir);
-
#define EMPTY ""
char glusterd_hook_dirnames[GD_OP_MAX][256] =
{
@@ -95,7 +93,7 @@ glusterd_hooks_create_hooks_directory (char *basedir)
priv = THIS->private;
snprintf (path, sizeof (path), "%s/hooks", basedir);
- ret = mkdir_if_missing (path);
+ ret = mkdir_if_missing (path, NULL);
if (ret) {
gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to create %s due"
"to %s", path, strerror (errno));
@@ -103,7 +101,7 @@ glusterd_hooks_create_hooks_directory (char *basedir)
}
GLUSTERD_GET_HOOKS_DIR (version_dir, GLUSTERD_HOOK_VER, priv);
- ret = mkdir_if_missing (version_dir);
+ ret = mkdir_if_missing (version_dir, NULL);
if (ret) {
gf_log (THIS->name, GF_LOG_CRITICAL, "Unable to create %s due "
"to %s", version_dir, strerror (errno));
@@ -117,7 +115,7 @@ glusterd_hooks_create_hooks_directory (char *basedir)
snprintf (path, sizeof (path), "%s/%s", version_dir,
cmd_subdir);
- ret = mkdir_if_missing (path);
+ ret = mkdir_if_missing (path, NULL);
if (ret) {
gf_log (THIS->name, GF_LOG_CRITICAL,
"Unable to create %s due to %s",
@@ -129,7 +127,7 @@ glusterd_hooks_create_hooks_directory (char *basedir)
type++) {
snprintf (path, sizeof (path), "%s/%s/%s",
version_dir, cmd_subdir, type_subdir[type]);
- ret = mkdir_if_missing (path);
+ ret = mkdir_if_missing (path, NULL);
if (ret) {
gf_log (THIS->name, GF_LOG_CRITICAL,
"Unable to create %s due to %s",