summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index ea26059b5..f436f5ece 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -2465,6 +2465,8 @@ glusterd_snap_brick_create (char *device, glusterd_volinfo_t *snap_volinfo,
char *snap_brick_dir = NULL;
char snap_brick_path[PATH_MAX] = {0, };
struct stat statbuf = {0, };
+ runner_t runner = {0, };
+ char msg[1024] = {0, };
this = THIS;
@@ -2536,9 +2538,22 @@ glusterd_snap_brick_create (char *device, glusterd_volinfo_t *snap_volinfo,
}
/* mount the snap logical device on the directory inside
/run/gluster/snaps/<snapname>/@snap_brick_mount_path
+ Way to mount the snap brick via mount api is this.
+ ret = mount (device, snap_brick_mount_path, entry->mnt_type, MS_MGC_VAL,
+ "nouuid");
+ But for now, mounting using runner apis.
*/
- ret = mount (device, snap_brick_mount_path, entry->mnt_type, MS_MGC_VAL,
- "nouuid");
+ runinit (&runner);
+ snprintf (msg, sizeof (msg), "mounting snapshot of the brick %s:%s",
+ original_brickinfo->hostname, original_brickinfo->path);
+ runner_add_args (&runner, "mount", "-t", entry->mnt_type,
+ "-o", "nouuid", device, snap_brick_mount_path, NULL);
+ runner_log (&runner, "", GF_LOG_DEBUG, msg);
+
+ //let glusterd get blocked till snapshot is over
+ synclock_unlock (&priv->big_lock);
+ ret = runner_run (&runner);
+ synclock_lock (&priv->big_lock);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "mounting the snapshot "
"logical device %s failed (error: %s)", device,