Bug 986948

Summary: quota: limit crosses for symlink
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Saurabh <saujain>
Component: glusterdAssignee: krishnan parthasarathi <kparthas>
Status: CLOSED ERRATA QA Contact: Saurabh <saujain>
Severity: high Docs Contact:
Priority: high    
Version: 2.1CC: asriram, grajaiya, kdhananj, kparthas, mzywusko, nsathyan, rhs-bugs, vbellur, vshastry
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glusterfs-3.4.0.34rhs Doc Type: Bug Fix
Doc Text:
Previously, setting quota limits on symlinks was possible to directories but fail to enforce quota. Now, in this update, setting quota limits on symlinks is not possible.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 15:29:35 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-07-22 13:29:03 UTC
Description of problem:
created a dir 
create a symlink
set quota limit on symlink
and limit crosses

Version-Release number of selected component (if applicable):
[root@nfs1 ~]# rpm -qa | grep glusterfs
glusterfs-3.4.0.12rhs.beta4-1.el6rhs.x86_64
glusterfs-fuse-3.4.0.12rhs.beta4-1.el6rhs.x86_64
glusterfs-server-3.4.0.12rhs.beta4-1.el6rhs.x86_64

How reproducible:
always

Steps to Reproduce:
1. create a volume, start it
2. enable quota on the volume
3. set some limit on quota
4. mount the volume using nfs.
5. create a dir
[root@rhsauto030 nfs-test]# mkdir foo
6. create a link for dir
[root@rhsauto030 nfs-test]# ln -s foo bar

[root@rhsauto030 nfs-test]# ls -l 
total 480
lrwxrwxrwx. 1 root root     3 Jul 22 07:54 bar -> foo
drwxr-xr-x. 2 root root    36 Jul 22 07:53 foo

7. set limit on the symlink,
[root@nfs1 ~]# gluster volume quota quota-dist-rep limit-usage /bar 10MB
hard limit set on /bar

8. create a file of 100MB now after cding in bar,

Actual results:

[root@rhsauto030 bar]# dd if=/dev/zero of=f.1 bs=100MB count=1
1+0 records in
1+0 records out
100000000 bytes (100 MB) copied, 4.6002 s, 21.7 MB/s


Expected results:
symlink should accept the quota policies.

Additional info:

Comment 3 vpshastry 2013-09-04 08:58:44 UTC
Working for me in my setup with the new build v3.4.0qa8. Can you verify?

Comment 4 vpshastry 2013-09-04 09:08:30 UTC
Cause: The update wasn't happening if it was a symlink in the older implementation, which is not the current case.

Comment 5 vpshastry 2013-09-04 10:31:06 UTC
Cause in detail: In the quotad while updating the quota-limit directories, if the path is a symlink, we were not following the symlink to update the directory with the usage. This causes the quota limits to exceed.

Comment 6 Gowrishankar Rajaiyan 2013-10-03 09:44:19 UTC
Can we please have the patch URL ?

Comment 9 errata-xmlrpc 2013-11-27 15:29:35 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