Bug 762443 (GLUSTER-711)

Summary: Wrong disk usage displayed in quota
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: quotaAssignee: Junaid <junaid>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: mainlineCC: amarts, gluster-bugs, jaz.cheng, vagarwal, vijay
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Raghavendra Bhat 2010-03-11 05:26:16 UTC
if device files are created (using mknod), then the total disk usage of all the device files becomes 7.9MB but df output shows used space as 0. And while creating those device files it dows not says "No disk space available". There are total 2000 device files.

Comment 1 Raghavendra Bhat 2010-03-11 06:45:30 UTC
same case with pipes, directories and even touching of files. Only dd files and copying some data containing files will increase the used space in the df output. Otherwise it will show used space as 0, but actually the total usage would be more than 40MB.

Comment 2 Raghavendra Bhat 2010-03-11 08:18:01 UTC
The quota translator is loaded above AFR with a disk-usage-limit of 5MB. When a 10MB file is written on the mount point using dd (dd if=/dev/zero of=file bs=1M count=10) then the command exited saying "closing file: No space left on device".
But when du command is issued on that file it shows the disk usage as 8.8 MB and 7.7 MB which is greater than 5MB. When df command is issued it shows usaed space as 5MB and available space as 0. 

Now if a 5MB file is created (dd if=/dev/zero of=file bs=1M count=5), then it creates the file, and if a 1MB file is created then it says no space left on the device and the 1MB file is not created. It seems when continuously data is being written, then it writes more than 5MB and then says "No space left on device."
Otherwise if a separate file is created other than the 5MB file, it works fine.

Comment 3 Pavan Vilas Sondur 2010-03-11 08:34:16 UTC
For all cases which create directories, device files and the like, we need to add/subtract values from their parent directories. Currently it's just checking the statbuf, which gives st_blocks =0 and quota assumes that it has not taken any disk space. Patch coming..

The continuous data scenario is also a manifestation of the same problem. Will verify it with fixes to the above.

We also need a fix for the quota xlator to be multiple clients compatible.

Comment 4 Anand Avati 2010-03-12 10:36:12 UTC
PATCH: http://patches.gluster.com/patch/2923 in release-3.0 (features/quota: Account for disk usage changes in directories and device files)

Comment 5 Anand Avati 2010-03-12 10:36:15 UTC
PATCH: http://patches.gluster.com/patch/2926 in release-3.0 (features/quota: Handle multiple clients on volume quotas.)

Comment 6 Anand Avati 2010-03-12 16:17:38 UTC
PATCH: http://patches.gluster.com/patch/2927 in release-3.0 (features/quota: Minor quota fixes due to xattrop FOP which results in quota not to work properly on the client side.)

Comment 7 Amar Tumballi 2010-05-04 08:23:51 UTC
Quota translator will be production ready only in release-3.1.x

Comment 8 Gluster Fan 2010-09-02 03:21:59 UTC
Will release-3.1.0 will fix this bug?

Comment 9 Amar Tumballi 2011-01-21 07:55:35 UTC
All quota related bugs in one place.

*** This bug has been marked as a duplicate of bug 1243 ***