Bug 884597 - dht linkfile are created with different owner:group than that source(data) file in few cases
dht linkfile are created with different owner:group than that source(data) fi...
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: distribute (Show other bugs)
mainline
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Nagaprasad Sathyanarayana
:
: 821139 (view as bug list)
Depends On:
Blocks: 895528 902200 1168392 1205785
  Show dependency treegraph
 
Reported: 2012-12-06 06:15 EST by Amar Tumballi
Modified: 2016-02-17 19:19 EST (History)
8 users (show)

See Also:
Fixed In Version: glusterfs-3.3.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 902200 1168392 (view as bug list)
Environment:
Last Closed: 2014-04-17 15:21:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Amar Tumballi 2012-12-06 06:15:25 EST
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 01:09:02 EST
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 01:56:11 EST
http://review.gluster.org/#change,4304 patch is under review.
Comment 3 Vijay Bellur 2013-02-13 12:31:48 EST
CHANGE: http://review.gluster.org/4269 (synctask: implement setuid-like SYNCTASK_SETID()) merged in master by Anand Avati (avati@redhat.com)
Comment 4 shishir gowda 2013-02-14 00:40:04 EST
CHANGE: http://review.gluster.org/#change,4304,patchset=11 has been merged in master
Comment 5 Vijay Bellur 2013-02-14 23:27:12 EST
CHANGE: http://review.gluster.org/4513 (cluster/distribute: Reopen fds in migration internally as root:root) merged in master by Anand Avati (avati@redhat.com)
Comment 6 shishir gowda 2013-02-26 01:45:53 EST
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 05:40:16 EST
CHANGE: http://review.gluster.org/4607 (cluster/dht: Create linkfile with file uid/gid) merged in release-3.4 by Vijay Bellur (vbellur@redhat.com)
Comment 8 Vijay Bellur 2013-03-04 05:42:52 EST
CHANGE: http://review.gluster.org/4611 (synctask: implement setuid-like SYNCTASK_SETID()) merged in release-3.4 by Vijay Bellur (vbellur@redhat.com)
Comment 9 Vijay Bellur 2013-03-04 05:43:05 EST
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@redhat.com)
Comment 10 Shawn Nock 2013-03-05 12:02:46 EST
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 06:02:52 EDT
*** Bug 821139 has been marked as a duplicate of this bug. ***
Comment 12 shishir gowda 2013-03-15 06:55:17 EDT
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 06:53:59 EDT
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#3) for review on master by Shishir Gowda (sgowda@redhat.com)
Comment 14 shishir gowda 2013-05-07 02:21:57 EDT
Moving the status back to POST, fix sent for review (comment 13)
Comment 15 Anand Avati 2013-05-16 10:16:25 EDT
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@redhat.com)
Comment 16 Anand Avati 2013-05-16 10:16:50 EDT
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@redhat.com)
Comment 17 Anand Avati 2013-05-16 11:48:15 EDT
COMMIT: http://review.gluster.org/5024 committed in release-3.3 by Vijay Bellur (vbellur@redhat.com) 
------
commit ddc0b45c4d4826e86500740f672892eeb28ab325
Author: shishir gowda <sgowda@redhat.com>
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@redhat.com>
    BUG: 884597
    Reviewed-on: http://review.gluster.org/5024
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
Comment 18 Anand Avati 2013-05-16 11:50:10 EDT
COMMIT: http://review.gluster.org/5025 committed in release-3.3 by Vijay Bellur (vbellur@redhat.com) 
------
commit 1a7e6053d3842761f946fbbdd693c72aa3945a97
Author: shishir gowda <sgowda@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/5025
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Comment 19 Anand Avati 2013-05-22 01:15:45 EDT
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#4) for review on master by Shishir Gowda (sgowda@redhat.com)
Comment 20 Anand Avati 2013-05-24 02:54:12 EDT
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#5) for review on master by Shishir Gowda (sgowda@redhat.com)
Comment 21 Anand Avati 2013-05-31 02:58:37 EDT
REVIEW: http://review.gluster.org/4682 (cluster/dht: Linkfiles creation with correct uid/gid) posted (#6) for review on master by Shishir Gowda (sgowda@redhat.com)
Comment 22 Anand Avati 2013-05-31 09:15:51 EDT
COMMIT: http://review.gluster.org/4682 committed in master by Vijay Bellur (vbellur@redhat.com) 
------
commit 003713139c8a7830a90a40dfead72f8299c17e31
Author: shishir gowda <sgowda@redhat.com>
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@redhat.com>
    Reviewed-on: http://review.gluster.org/4682
    Tested-by: Gluster Build System <jenkins@build.gluster.com>
    Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Comment 25 Niels de Vos 2014-04-17 15:21:33 EDT
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.