Bug 1003736

Summary: quota+rootsquash: unable to set limit on a non-root user directory if root-squash is on
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Saurabh <saujain>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED ERRATA QA Contact: Sudhir D <sdharane>
Severity: high Docs Contact:
Priority: urgent    
Version: 2.1CC: amarts, asriram, kparthas, mzywusko, nsathyan, rhs-bugs, vbellur
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.4.0.33rhs-1 Doc Type: Bug Fix
Doc Text:
Previously, when the permissions of the directory was changed to a non-root user and root-squash option was enalbed, setting quota limit for the directory failed. Now, with the changes made to the root-squash algoritm in this update, setting quota limits on a directory with a non-root owner is successful.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 15:36:17 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:

Description Saurabh 2013-09-03 05:47:41 UTC
Description of problem:
created a dir and changed the credentials of the dir to a non-root user.
then with root-squash on, tried to set limit for quota and it failed.

same is not seen when root-squash it put to off

Version-Release number of selected component (if applicable):
glusterfs-geo-replication-3.4.0.30rhs-2.el6rhs.x86_64
samba-glusterfs-3.6.9-160.3.el6rhs.x86_64
glusterfs-libs-3.4.0.30rhs-2.el6rhs.x86_64
glusterfs-3.4.0.30rhs-2.el6rhs.x86_64
glusterfs-server-3.4.0.30rhs-2.el6rhs.x86_64
glusterfs-rdma-3.4.0.30rhs-2.el6rhs.x86_64
glusterfs-api-3.4.0.30rhs-2.el6rhs.x86_64
glusterfs-fuse-3.4.0.30rhs-2.el6rhs.x86_64


How reproducible:
always

Steps to Reproduce:

1. create a directory
2. chown <some nonroot-user>:<some nonroot group> dir
3. root-squash on
4. quota enable 
5. set limit on dir created in step 1

Actual results:
Volume Name: dr1
Type: Distributed-Replicate
Volume ID: 72c8ab3e-7cb4-4313-9c61-bd4a85f60550
Status: Started
Number of Bricks: 6 x 2 = 12
Transport-type: tcp
Bricks:
Brick1: 10.70.37.213:/rhs/bricks/d1r1-1
Brick2: 10.70.37.145:/rhs/bricks/d1r2-1
Brick3: 10.70.37.68:/rhs/bricks/d2r1-1
Brick4: 10.70.37.76:/rhs/bricks/d2r2-1
Brick5: 10.70.37.213:/rhs/bricks/d3r1-1
Brick6: 10.70.37.145:/rhs/bricks/d3r2-1
Brick7: 10.70.37.68:/rhs/bricks/d4r1-1
Brick8: 10.70.37.76:/rhs/bricks/d4r2-1
Brick9: 10.70.37.213:/rhs/bricks/d5r1-1
Brick10: 10.70.37.145:/rhs/bricks/d5r2-1
Brick11: 10.70.37.68:/rhs/bricks/d6r1-1
Brick12: 10.70.37.76:/rhs/bricks/d6r2-1
Options Reconfigured:
server.root-squash: on
[root@nfs1 glusterfs-test]# gluster volume quota dr1 enable
volume quota : success
[root@nfs1 glusterfs-test]# gluster volume quota dr1 limit-usage /saurabh-dir 1GB
quota command failed : setxattr of 'trusted.glusterfs.quota.limit-set' failed on /tmp/dr1/saurabh-dir. Reason : Permission denied
[root@nfs1 glusterfs-test]# 



[root@rhsauto036 ~]# ls -l /mnt/nfs-test-dr1
total 1
drwxrwxrwx. 4 root    root    329 Sep  2 14:24 dir
-rw-r--r--. 1 root    root     12 Sep  2 00:16 nemo
-rwx------. 1 root    root     21 Sep  2 00:19 nepti
drwxr-xr-x. 2 saurabh saurabh  47 Sep  2 01:09 saurabh-dir

[root@nfs1 glusterfs-test]# 

Expected results:
rootsquash should not hamper setting limit on a directory

Additional info:

Comment 4 errata-xmlrpc 2013-11-27 15:36:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1769.html