Bug 1599788

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: 3.12CC: bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.12.3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1599783 Environment:
Last Closed: 2018-09-05 05:10:51 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:18:45 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:43:30 UTC
REVIEW: https://review.gluster.org/20492 (glusterd: _is_prefix should handle 0-length paths) posted (#1) for review on release-3.12 by Kaushal M

Comment 2 Worker Ant 2018-07-11 05:31:15 UTC
REVIEW: https://review.gluster.org/20492 (glusterd: _is_prefix should handle 0-length paths) posted (#2) for review on release-3.12 by Kaushal M

Comment 3 Worker Ant 2018-08-17 05:34:51 UTC
COMMIT: https://review.gluster.org/20492 committed in release-3.12 by "jiffin tony Thottan" <jthottan> 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
BUG: 1599788
Signed-off-by: Kaushal M <kaushal>

Comment 4 Jiffin 2018-09-05 05:10:51 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-3.12.3, please open a new bug report.

glusterfs-3.12.3 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-August/000107.html
[2] https://www.gluster.org/pipermail/gluster-users/