Bug 1127772

Summary: DHT + rebalance :- file permission got changed (sticky bit and setgid is removed) after file migration
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rachana Patel <racpatel>
Component: distributeAssignee: Nithya Balachandran <nbalacha>
Status: CLOSED WORKSFORME QA Contact: amainkar
Severity: medium Docs Contact:
Priority: medium    
Version: rhgs-3.0CC: nbalacha, srangana, surs, vagarwal
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.0.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The rebalance process now preserves the sticky bit, SUID and SGID permissions originally set on a file that is migrated.
Story Points: ---
Clone Of:
: 1162119 (view as bug list) Environment:
Last Closed: 2014-11-11 11:12:42 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: 1162119    

Description Rachana Patel 2014-08-07 14:15:20 UTC
Description of problem:
=======================
If file has sticky bit and setgid is set, after migration it is removed:-


before rebalance:-
[root@OVM1 loss]# ls -l
total 10240
-rw-r-Sr-T 1 root root 10485760 Aug  7 15:47 rename

After rebalance:-

[root@OVM1 loss]# ls -l
total 10240
-rw-r--r-- 1 root root 10485760 Aug  7 15:47 rename

 

Version-Release number of selected component (if applicable):
=============================================================
3.6.0.27-1.el6rhs.x86_64

How reproducible:
=================
haven't tried


Steps to Reproduce:
===================
1. create, start and FUSE mount Distributed volume having 3 bricks. 
2. created file having size in GB and change permission so it has sticky bit and setgid set. Renamed it so hashed and cached sub-volumes are different

[root@OVM1 loss]# ls -l
total 10240
-rw-r-Sr-T 1 root root 10485760 Aug  7 15:47 rename

3. started rebalance process for that volume. Once rebalance is completed.

4. checked file from mount point it has different permission.
[root@OVM1 loss]# ls -l
total 10240
-rw-r--r-- 1 root root 10485760 Aug  7 15:47 rename


Actual results:
================
It removed sticky bit and setgid bit


Expected results:
================
file permissions should not be changed

Comment 4 Shyamsundar 2014-08-11 14:18:35 UTC
Code does not handle this preservation as these bits are used to signal to clients that migration is in progress, etc.

In function dht_migrate_file,  the current TOTO reads,

/* TODO: if the source actually had sticky bit, or sgid bit set, we are not handling it */

This needs to be fixed for this issue to be cleared up.

Comment 7 Rachana Patel 2014-11-11 11:03:13 UTC
working as expected on build 3.6.0.29-1.el6rhs.x86_64 hence closing this bug and opening new for issues mentioned in comment # 6