Bug 1003755 - quota: accounting doesn't work properly with hard links
Summary: quota: accounting doesn't work properly with hard links
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: quota
Version: 2.1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Vijaikumar Mallikarjuna
QA Contact: Saurabh
URL:
Whiteboard:
Depends On:
Blocks: 957769
TreeView+ depends on / blocked
 
Reported: 2013-09-03 07:03 UTC by vpshastry
Modified: 2016-09-17 12:36 UTC (History)
11 users (show)

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.
Clone Of:
Environment:
Last Closed: 2015-08-06 10:04:30 UTC
Embargoed:


Attachments (Terms of Use)

Description vpshastry 2013-09-03 07:03:38 UTC
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 10:28:30 UTC
Please sign off on the doc text.

Comment 3 Vivek Agarwal 2013-10-17 07:26:31 UTC
Per discussion with Shanks and Saurabh, we are not supporting hard links. Removing this from u1

Comment 7 Vijaikumar Mallikarjuna 2015-08-06 10:04:30 UTC
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.