Bug 1017728

Summary: quota: decimal digits not shown properly for "df -h"
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Saurabh <saujain>
Component: quotaAssignee: Susant Kumar Palai <spalai>
Status: CLOSED NOTABUG QA Contact: storage-qa-internal <storage-qa-internal>
Severity: high Docs Contact:
Priority: medium    
Version: 2.1CC: grajaiya, mzywusko, rhs-bugs, storage-qa-internal, vagarwal, vbellur, vmallika
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
On setting the quota limit as a decimal digit and setting the deem-statfs on, a difference is noticed in the values displayed by the df -h command and gluster volume quota <volname> list command. In case of the gluster volume quota <volname> list command, the values do not get rounded off to the next integer.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-12 09:05:32 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:
Bug Depends On:    
Bug Blocks: 1020127    

Description Saurabh 2013-10-10 11:59:58 UTC
Description of problem:
I have set limit as a decimal digit, and deem-statfs is set to on.
now on "df -h" the result of limit set id rounded off and displayed.

where as this should not be the case

Version-Release number of selected component (if applicable):
glusterfs-3.4.0.34rhs-1.el6rhs.x86_64

How reproducible:
always

Steps to Reproduce:
1. create a volume, start it
2. enable quota, set quota for 10.5 GB on "/"
gluster volume quota dist-rep1 list 
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                         10.5GB       80%       3.1GB   7.4GB
3. mount it over nfs on client.
4. df -h

Actual results:
df -h
======
10.70.42.186:/dist-rep1
                       11G  3.1G  7.5G  30% /mnt/nfs-test

similarly with other values,

[root@quota1 ~]# gluster volume quota dist-rep1 list 
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                         10.1GB       80%       3.1GB   7.0GB

df -h
======
10.70.42.186:/dist-rep1
                       11G  3.1G  7.1G  31% /mnt/nfs-test

Expected results:
the "Size" field of "df -h" should show values as set.

As in case of kernel nfs mount,
rhsqe-repo.lab.eng.blr.redhat.com:/opt
                      1.9T  105G  1.7T   6% /opt

it still displayes "1.9T" not a rounded off figure

Additional info:

Comment 2 Gowrishankar Rajaiyan 2013-10-17 10:25:13 UTC
Per bug triage 10/17.

Comment 3 Vivek Agarwal 2013-10-28 08:47:38 UTC
The quota command shows values which are more precise then df does and hence this should not be considered a bug. Yes it is different, but as far as it is not wrong (more correct in this case), we should be fine. 

Unless I have missed something, this should not be called a  bug at all, or I must be missing something

Comment 4 Saurabh 2013-10-28 11:38:59 UTC
This is an important bug, not sure whether we want to take it for "U1" or not.

The importance of this can be understood by the use case I mention below,

" A combination of quota-deem-statfs, quota is used for standard tools like df to represent the actual size allocated to a directory."

Now, a directory can be decimal digits as well, lets "1.5TB" or "2.5TB" 
Now, a non-root user(on some other node) will not be having access to a server to check the quota limit using "gluster volume quota $volname list" command.
He can only use df -h. 
Now with this bug, a non-root user(on some other node) will be having impression of having "3TB" in case of 2.5TB, which literally can mess up the things. 

In fact, "df -h" to show quota limits set is required is because of one of the reasons that I have mentioned above, i.e. nodes other then RHSS can check the quota limits. 

So giving a wrong information will not be a good idea.

Comment 5 Pavithra 2013-11-25 06:54:57 UTC
I've documented this as a known issue in the Big Bend Update 1 Release Notes.
Here is the link:

http://documentation-devel.engineering.redhat.com/docs/en-US/Red_Hat_Storage/2.1/html/2.1_Update_1_Release_Notes/chap-Documentation-2.1_Update_1_Release_Notes-Known_Issues.html

Comment 6 Vijaikumar Mallikarjuna 2015-01-12 09:05:32 UTC
The issue is not with the quota. This is with 'df application'.
To get the accurate value, run df command without '-h' option.

Closing as 'NOTABUG'