summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 82ff8826843..a8aa577be80 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -3479,7 +3479,8 @@ glusterd_is_valid_volfpath (char *volname, char *brick)
strncpy (volinfo->volname, volname, sizeof (volinfo->volname));
get_brick_filepath (volfpath, volinfo, brickinfo);
- ret = (strlen (volfpath) < _POSIX_PATH_MAX);
+ ret = ((strlen(volfpath) < PATH_MAX) &&
+ strlen (strrchr(volfpath, '/')) < _POSIX_PATH_MAX);
out:
if (brickinfo)