Bug 1003755 - quota: accounting doesn't work properly with hard links
quota: accounting doesn't work properly with hard links
Status: CLOSED DEFERRED
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: quota (Show other bugs)
2.1
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Vijaikumar Mallikarjuna
Saurabh
: ZStream
Depends On:
Blocks: 957769
  Show dependency treegraph
 
Reported: 2013-09-03 03:03 EDT by vpshastry
Modified: 2016-09-17 08:36 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Known Issue
Doc Text:
Directory Quotas feature does not work well with hardlinks. With a directory that has Quota limit set, the disk usage seen with the du - command and the disk usage seen with the gluster volume quota VOLNAME list <directory> command may differ. It is recommended that applications writing to a volume with directory quotas enabled, do not use hardlinks.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-06 06:04:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description vpshastry 2013-09-03 03:03:38 EDT
Description of problem:
When created hard links across different quota limit set directories, quota list doesn't show proper size utilization. The below specified is just one use case I could consistently reproduce the bug. I found few more cases hard links screws  the quota accounting.

Version-Release number of selected component (if applicable):
rhs-2.1 

How reproducible:
Always

Steps to Reproduce:
1. Create distribute volume, start, enable quota.
2. set limit on a dir say /dir
3. create a file of say 5MB in dir/testfile.
4. ln dir/testfile dir/newtestfile
5. rm -f dir/newtestfile

Now the quota list shows the size utilized on d1 to be zero.

Actual results:

root@-d# ls
dir
root@-d# dd if=/dev/urandom of=dir/file
^C10537+0 records in
10537+0 records out
5394944 bytes (5.4 MB) copied, 0.886182 s, 6.1 MB/s

root@-d# gv q d list
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/dir                                     100.0MB       80%       5.1MB  94.9MB
root@-d# ln dir/file dir/newfile
root@-d# gv q d list
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/dir                                     100.0MB       80%       5.1MB  94.9MB
root@-d# rm -f dir/newfile 
root@-d# gv q d list
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/dir                                     100.0MB       80%      0Bytes 100.0MB
root@-d# 

Expected results:

After the rm -f of newfilconsistantlye. the dir should still show 5.1MB as used as the file is still present.

Additional info:
Comment 2 Pavithra 2013-09-03 06:28:30 EDT
Please sign off on the doc text.
Comment 3 Vivek Agarwal 2013-10-17 03:26:31 EDT
Per discussion with Shanks and Saurabh, we are not supporting hard links. Removing this from u1
Comment 7 Vijaikumar Mallikarjuna 2015-08-06 06:04:30 EDT
As of now quota is not supported for hard-links, so closing the bug.

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