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.
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:
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: