Bug 1179658

Summary: Add brick fails if parent dir of new brick and existing brick is same and volume was accessed using libgfapi and smb.
Product: [Community] GlusterFS Reporter: Raghavendra Talur <rtalur>
Component: libgfapiAssignee: Raghavendra Talur <rtalur>
Status: CLOSED CURRENTRELEASE QA Contact: Sudhir D <sdharane>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.6.1CC: bugs, gluster-bugs, rabhat
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.6.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-11 09:10:09 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:    
Bug Blocks: 1163723    

Description Raghavendra Talur 2015-01-07 09:47:39 UTC
Description of problem:

While doing an add-brick test saw following error :

# gluster vol add-brick afr-vol 10.16.159.197:/rhs/brick1/afr-vol/b10 10.16.159.210:/rhs/brick1/afr-vol/b11
volume add-brick: failed: parent directory /rhs/brick1/afr-vol is already part of a volume
The error looks like the xattr is been set on parent directory so it is not allowing the add-brick.

Workaround: To remove the xattr on parent dir and then it allows to do add-brick.


How reproducible:
Always.


Steps to Reproduce:
1. Create a volume and access it using Windows Explorer using Samba over libgfapi.
2. Perform a add brick operation with new brick under same dir as an existing brick.


Actual results:
Add brick fails with error saying brick(parent dir of new brick) is already part of the volume.


Expected results:
Add brick should succeed as new brick is not part of any volume.


Additional info:
This happens because when accessed through gfapi xattrs may have been set on the parent of brick.

Comment 1 Anand Avati 2015-01-07 09:54:42 UTC
REVIEW: http://review.gluster.org/9403 (gfapi: Change lookup logic for "/.." and "/." .) posted (#1) for review on release-3.6 by Raghavendra Talur (rtalur)

Comment 2 Anand Avati 2015-01-08 09:40:16 UTC
COMMIT: http://review.gluster.org/9403 committed in release-3.6 by Raghavendra Bhat (raghavendra) 
------
commit b55c8920b50fff18937b2ab213e2b168f534a84e
Author: Raghavendra Talur <rtalur>
Date:   Thu Sep 18 11:47:23 2014 +0530

    gfapi: Change lookup logic for "/.." and "/." .
    
            Backport of http://review.gluster.org/#/c/8455
    
    We should handle /.. and /. in unique way,
    otherwise we may end up setting glusterfs xattrs
    on parent of the brick dir.
    
    Change-Id: Id317cd625436734f496852b8513f3e9dc1c4fa4e
    BUG: 1179658
    Signed-off-by: Raghavendra Talur <rtalur>
    Reviewed-on: http://review.gluster.org/9403
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: soumya k <skoduri>
    Reviewed-by: Poornima G <pgurusid>
    Reviewed-by: Raghavendra Bhat <raghavendra>

Comment 3 Raghavendra Bhat 2015-02-11 09:10:09 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.6.2, please reopen this bug report.

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

The fix for this bug likely to be included in all future GlusterFS releases i.e. release > 3.6.2.

[1] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/5978
[2] http://news.gmane.org/gmane.comp.file-systems.gluster.user
[3] http://thread.gmane.org/gmane.comp.file-systems.gluster.devel/6137