Bug 884597 - dht linkfile are created with different owner:group than that source(data) file in few cases
Summary: dht linkfile are created with different owner:group than that source(data) fi...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: distribute
Version: mainline
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Nagaprasad Sathyanarayana
QA Contact:
URL:
Whiteboard:
: 821139 (view as bug list)
Depends On:
Blocks: 895528 902200 1168392 1205785
TreeView+ depends on / blocked
 
Reported: 2012-12-06 11:15 UTC by Amar Tumballi
Modified: 2016-02-18 00:19 UTC (History)
8 users (show)

Fixed In Version: glusterfs-3.3.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 902200 1168392 (view as bug list)
Environment:
Last Closed: 2014-04-17 19:21:33 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Amar Tumballi 2012-12-06 11:15:25 UTC
Description of problem:

As of today in distribute translator, we do a self-heal for creating dht link file, in which case, the frame->root->uid/gid of the frame which does lookup will be set as uid:gid of the linkfile.

Also in case of rename() and link(), the uid:gid of the process which does rename would be used for linkfile's uid:gid.

  

Expected results:

The dht linkfile should have ownership same as that of source file.

Comment 1 Amar Tumballi 2012-12-07 06:09:02 UTC
http://review.gluster.org/4194 would fix the issue, but one of the review comment was against using xdata for solving this problem. Hence we would need more of 'copy_frame()' for creating the dht linkfile.

Comment 2 shishir gowda 2012-12-13 06:56:11 UTC
http://review.gluster.org/#change,4304 patch is under review.

Comment 3 Vijay Bellur 2013-02-13 17:31:48 UTC
CHANGE: http://review.gluster.org/4269 (synctask: implement setuid-like SYNCTASK_SETID()) merged in master by Anand Avati (avati)

Comment 4 shishir gowda 2013-02-14 05:40:04 UTC
CHANGE: http://review.gluster.org/#change,4304,patchset=11 has been merged in master

Comment 5 Vijay Bellur 2013-02-15 04:27:12 UTC
CHANGE: http://review.gluster.org/4513 (cluster/distribute: Reopen fds in migration internally as root:root) merged in master by Anand Avati (avati)

Comment 6 shishir gowda 2013-02-26 06:45:53 UTC
We had kept the bug open, as a setattr would take the linkfile/src file out of sync w.r.t their permissions (setattr currently happens only on the src (cached file).

After investigating, we decided, the fix is not required as
1. A rebalance will fix the uid/gid during migration
2. A migration in progress check in setattr handle linkfile(hashed file) to get the right permissions.
3. All internal fd open (migration related) is done as root:root.

Moving the state to MODIFIED, as all required fixes are merged upstream

Comment 7 Vijay Bellur 2013-03-04 10:40:16 UTC
CHANGE: http://review.gluster.org/4607 (cluster/dht: Create linkfile with file uid/gid) merged in release-3.4 by Vijay Bellur (vbellur)

Comment 8 Vijay Bellur 2013-03-04 10:42:52 UTC
CHANGE: http://review.gluster.org/4611 (synctask: implement setuid-like SYNCTASK_SETID()) merged in release-3.4 by Vijay Bellur (vbellur)

Comment 9 Vijay Bellur 2013-03-04 10:43:05 UTC
CHANGE: http://review.gluster.org/4612 (cluster/distribute: Reopen fds in migration internally as root:root) merged in release-3.4 by Vijay Bellur (vbellur)

Comment 10 Shawn Nock 2013-03-05 17:02:46 UTC
I think this unaddressed 3.3.0 bug may be related:

https://bugzilla.redhat.com/show_bug.cgi?id=913699

A backport may be valuable for the community.

Comment 11 shishir gowda 2013-03-12 10:02:52 UTC
*** Bug 821139 has been marked as a duplicate of this bug. ***

Comment 12 shishir gowda 2013-03-15 10:55:17 UTC
Hi Shawn,

The fix has been back-ported to release-3.4, which is in the alpha stage. Currenlty release-3.4.0alpha2 has the fix (http://bits.gluster.org/pub/gluster/glusterfs/3.4.0alpha2/)

Comment 13 Anand Avati 2013-05-02 10:53:59 UTC
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#3) for review on master by Shishir Gowda (sgowda)

Comment 14 shishir gowda 2013-05-07 06:21:57 UTC
Moving the status back to POST, fix sent for review (comment 13)

Comment 15 Anand Avati 2013-05-16 14:16:25 UTC
REVIEW: http://review.gluster.org/5024 (cluster/dht: Create linkfile with file uid/gid) posted (#1) for review on release-3.3 by Shishir Gowda (sgowda)

Comment 16 Anand Avati 2013-05-16 14:16:50 UTC
REVIEW: http://review.gluster.org/5025 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#1) for review on release-3.3 by Shishir Gowda (sgowda)

Comment 17 Anand Avati 2013-05-16 15:48:15 UTC
COMMIT: http://review.gluster.org/5024 committed in release-3.3 by Vijay Bellur (vbellur) 
------
commit ddc0b45c4d4826e86500740f672892eeb28ab325
Author: shishir gowda <sgowda>
Date:   Thu May 16 19:25:25 2013 +0530

    cluster/dht: Create linkfile with file uid/gid
    
    Currently, linkfile creation happens as root.
    
    use uid/gid returned from _cbk (link/rename) to set the correct ownership of
    the link files.
    
    Change-Id: I5345cff193d5095442ca446fbe5ea05f2c2d86a3
    Signed-off-by: shishir gowda <sgowda>
    BUG: 884597
    Reviewed-on: http://review.gluster.org/5024
    Reviewed-by: Vijay Bellur <vbellur>
    Tested-by: Gluster Build System <jenkins.com>

Comment 18 Anand Avati 2013-05-16 15:50:10 UTC
COMMIT: http://review.gluster.org/5025 committed in release-3.3 by Vijay Bellur (vbellur) 
------
commit 1a7e6053d3842761f946fbbdd693c72aa3945a97
Author: shishir gowda <sgowda>
Date:   Thu May 16 19:32:49 2013 +0530

    cluster/dht: Linkfiles creation with correct uid/gid
    
    If renames are done with different uid/gid (non-owners), then we would
    end up with incorrect uid/gid.
    
    The fix is to create linkfiles, and heal the uid/gid as root:root. This
    preserves our notion of creation as root:root and heal the uid/gid as
    root:root in all paths. Additionally, we need to consider uid/gid from
    only src_cached subvol, and not from linkfiles.
    
    rename is also done as root:root if done on linkfile, as setattr of ownership
    on linkfile is done after the rename
    
    BUG: 884597
    Change-Id: Ifaacd8dba0f39cb909761ffc8fe7e06cd44ec8de
    Signed-off-by: shishir gowda <sgowda>
    Reviewed-on: http://review.gluster.org/5025
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Vijay Bellur <vbellur>

Comment 19 Anand Avati 2013-05-22 05:15:45 UTC
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#4) for review on master by Shishir Gowda (sgowda)

Comment 20 Anand Avati 2013-05-24 06:54:12 UTC
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#5) for review on master by Shishir Gowda (sgowda)

Comment 21 Anand Avati 2013-05-31 06:58:37 UTC
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#6) for review on master by Shishir Gowda (sgowda)

Comment 22 Anand Avati 2013-05-31 13:15:51 UTC
COMMIT: http://review.gluster.org/4682 committed in master by Vijay Bellur (vbellur) 
------
commit 003713139c8a7830a90a40dfead72f8299c17e31
Author: shishir gowda <sgowda>
Date:   Mon Mar 18 14:44:20 2013 +0530

    cluster/dht: Linkfiles creation with correct uid/gid
    
    If renames are done with different uid/gid (non-owners), then we would
    end up with incorrect uid/gid.
    
    The fix is to create linkfiles, and heal the uid/gid as root:root. This
    preserves our notion of creation as root:root and heal the uid/gid as
    root:root in all paths. Additionally, we need to consider uid/gid from
    only src_cached subvol, and not from linkfiles.
    
    rename is also done as root:root if done on linkfile, as setattr of ownership
    on linkfile is done after the rename
    
    Change-Id: Icb5d431dc42da9c02dfae81980e3fe769a47a274
    BUG: 884597
    Signed-off-by: shishir gowda <sgowda>
    Reviewed-on: http://review.gluster.org/4682
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Jeff Darcy <jdarcy>

Comment 25 Niels de Vos 2014-04-17 19:21:33 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.3.2, please reopen this bug report.

The fix for this bug likely to be included in all future GlusterFS releases i.e. release > 3.3.2. In the same line the recent release i.e. glusterfs-3.4.3 [1] and glusterfs-3.5.0 [2] likely to have the fix. You can verify this by reading the comments in this bug report and checking for comments mentioning "committed in release-3.4" and/or "committed in release-3.5".

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


Note You need to log in before you can comment on or make changes to this bug.