Skip to content

Commit

Permalink
glusterd: mount directory getting truncated on mounting shared_storage
Browse files Browse the repository at this point in the history
Issue:
In case of a user created volume the mount point
is the brick path 'ex: /data/brick' but in case of
shared_storage the mount point is '/'.So, here
we increment the array by one so as to get the exact
path of brick without '/', which works fine for other
volumes as the pointer of the brick_dir variable is
at '/', but for shared_storage it is at 'v'(where v is
starting letter of 'var' directory). So, on incrementing
the path we get in case of shared_storage starts from
'ar/lib/glusterd/...'

Fix:
Only, increment the pointer if the current position is '/',
else the path will be wrong.

Fixes: gluster#1480

Change-Id: Id31bb13f58134ae2099884fbc5984c4e055fb357
Signed-off-by: nik-redhat <[email protected]>
  • Loading branch information
nik-redhat authored and Sanju Rakonde committed Sep 20, 2020
1 parent 558fe62 commit 0ec6d61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xlators/mgmt/glusterd/src/glusterd-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,8 @@ glusterd_get_brick_mount_dir(char *brickpath, char *hostname, char *mount_dir)
}

brick_dir = &brickpath[strlen(mnt_pt)];
brick_dir++;
if (brick_dir[0] == '/')
brick_dir++;

snprintf(mount_dir, VALID_GLUSTERD_PATHMAX, "/%s", brick_dir);
}
Expand Down

0 comments on commit 0ec6d61

Please sign in to comment.