From f20d895a8ed2a3ee032bd0f85d5bfaf645575fd7 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 12 Mar 2012 17:50:34 +0530 Subject: mgmt/glusterd: don't create the brick path in 'volume start' create the missing brick directory only on a 'gluster volume start force' command Change-Id: Ica4fab9cefe953d73de9a30843d48f94e6ab735c Signed-off-by: Amar Tumballi BUG: 801610 Reviewed-on: http://review.gluster.com/2921 Tested-by: Gluster Build System Reviewed-by: Rajesh Amaravathi Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volume-ops.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 93c00983a..f0d8c70d8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -823,7 +823,13 @@ glusterd_op_stage_start_volume (dict_t *dict, char **op_errstr) goto out; } - if (!uuid_compare (brickinfo->uuid, priv->uuid)) { + /* we should not be creating the directory if 'force' option + is not given. This may lead to issues where the actual data + disk is not mounted after a machine reboot, but because + 'glusterd' restarts the processes, the export directories + can be automatically created and brick would start */ + if ((flags & GF_CLI_FLAG_OP_FORCE) && + !uuid_compare (brickinfo->uuid, priv->uuid)) { ret = glusterd_brick_create_path (brickinfo->hostname, brickinfo->path, volinfo->volume_id, -- cgit