Bug 1599785

Summary: _is_prefix should return false for 0-length strings
Product: [Community] GlusterFS Reporter: Kaushal <kaushal>
Component: glusterdAssignee: Kaushal <kaushal>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.1CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-4.1.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1599783 Environment:
Last Closed: 2018-07-30 19:02:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1599783    
Bug Blocks:    

Description Kaushal 2018-07-10 15:16:38 UTC
+++ This bug was initially created as a clone of Bug #1599783 +++

The `_is_prefix` function in glusterd-utils.c is used to check if one of 2 given paths contains the other. When one of the passed paths is a 0-length string, `_is_prefix` returns true. This is incorrect, as a 0-length string is not a path, and isn't a prefix of the other.

The current behaviour sometimes causes problems when creating new volumes, as it causes new brick paths to appear to contain/be contained by old bricks.
Because of issues with volume deletion and volume sync, there are cases when stale volumes with stale and incomplete brickinfo could be present.

Comment 1 Worker Ant 2018-07-10 15:40:57 UTC
REVIEW: https://review.gluster.org/20491 (glusterd: _is_prefix should handle 0-length paths) posted (#1) for review on release-4.1 by Kaushal M

Comment 2 Worker Ant 2018-07-24 10:29:37 UTC
COMMIT: https://review.gluster.org/20491 committed in release-4.1 by "Shyamsundar Ranganathan" <srangana> with a commit message- glusterd: _is_prefix should handle 0-length paths

If one of the paths given to _is_prefix is 0-length, then it is not a
prefix of the other. Hence, _is_prefix should return false.

Change-Id: I54aa577a64a58940ec91872d0d74dc19cff9106d
fixes: bz#1599785
Signed-off-by: Kaushal M <kaushal>

Comment 3 Shyamsundar 2018-07-30 19:02:48 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-4.1.2, please open a new bug report.

glusterfs-4.1.2 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://lists.gluster.org/pipermail/announce/2018-July/000106.html
[2] https://www.gluster.org/pipermail/gluster-users/