Bug 1294751

Summary: Able to create files when quota limit is set to 0
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Bhaskarakiran <byarlaga>
Component: quotaAssignee: Manikandan <mselvaga>
Status: CLOSED ERRATA QA Contact: Anil Shah <ashah>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rhgs-3.1CC: mselvaga, mzywusko, rcyriac, rhinduja, rhs-bugs, sankarshan, smohan, storage-qa-internal
Target Milestone: ---Keywords: ZStream
Target Release: RHGS 3.1.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.7.9-2 Doc Type: Bug Fix
Doc Text:
When the quota limit is set to zero, quota enforcement is disabled, rather than enforcing a quota limit of 0 and preventing any writes. To prevent confusion when using this option, numbers smaller than or equal to zero are no longer valid values.
Story Points: ---
Clone Of:
: 1302554 (view as bug list) Environment:
Last Closed: 2016-06-23 05:00:54 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: 1299184, 1302554, 1306136    

Description Bhaskarakiran 2015-12-30 06:04:55 UTC
Description of problem:
=======================
When the quota limit is set to 0, writes still go through. quota list shows the limits are exceeded. 

[root@transformers ~]# gluster v quota disperse_vol2 list
                  Path                   Hard-limit  Soft-limit      Used  Available  Soft-limit exceeded? Hard-limit exceeded?
-------------------------------------------------------------------------------------------------------------------------------
/                                         0Bytes     80%(0Bytes)   18.1GB  0Bytes             Yes                  Yes
[root@transformers ~]# 

[root@rhs-client17 fuse]# df -h .
Filesystem                   Size  Used Avail Use% Mounted on
transformers:/disperse_vol2  4.2T  1.2T  3.0T  28% /mnt/fuse
[root@rhs-client17 fuse]# 


Version-Release number of selected component (if applicable):
==============================================================
3.7.5-13

[root@transformers ~]# gluster --version
glusterfs 3.7.5 built on Dec 22 2015 19:44:25
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2011 Gluster Inc. <http://www.gluster.com>
GlusterFS comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GlusterFS under the terms of the GNU General Public License.
[root@transformers ~]# 

How reproducible:
================
100%

Steps to Reproduce:
1. Create a disperse / distribute volume and set the quota limit on / to 0
2. Try creating files from client
3. Check the quota list 

Actual results:
===============
No disk quota exceeded message and write still go through


Expected results:
================
Disk quota exceeded


Additional info:

Comment 2 Vijaikumar Mallikarjuna 2015-12-30 06:07:13 UTC
Quota enforcer assumes that if hard-limit is 0, then there is no limit set.
Solution:
1) don't allow user to set limit to 0
or
2) quota enforcer should treat hard-limit 0 is a valid limit set

Comment 3 Vijaikumar Mallikarjuna 2016-02-02 11:01:45 UTC
Patch submitted upstream: http://review.gluster.org/#/c/13309/

Comment 5 Mike McCune 2016-03-28 23:10:48 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 6 Vijaikumar Mallikarjuna 2016-04-07 03:03:22 UTC
Fix "http://review.gluster.org/#/c/13309/" is available in 3.1.3 as part of rebase

Comment 8 Anil Shah 2016-04-26 06:23:29 UTC
[root@dhcp46-4 ~]# glusterfind  list
SESSION                   VOLUME                    SESSION TIME             
---------------------------------------------------------------------------
sess_abc                  testvol                   2016-04-25 18:05:02      
[root@dhcp46-4 ~]# glusterfind pre sess_abc testvol /tmp/output.txt --regenerate-outfile --no-encodeGenerated output file /tmp/output.txt
[root@dhcp46-4 ~]# cat /tmp/output.txt 
NEW контрольная 
DELETE контрольная~ 
NEW Здравствуйте 
NEW Здравствуйте/Здравствуйте 
NEW азбука 
NEW промышленность 
NEW промышленность/круто 
DELETE Мир~ 
NEW Мир 

Bug verified on build glusterfs-3.7.9-2.el7rhgs.x86_64

Comment 9 Anil Shah 2016-04-26 06:32:10 UTC
Updated wrong bug, moving this bug to ON_QA again.

Comment 10 Anil Shah 2016-04-26 07:18:24 UTC
Not able to set linit usage 0.
[root@dhcp46-4 ~]# gluster v quota dist-vol limit-usage / 0GB
Please enter an integer value in the range of (1 - 9223372036854775807)
Usage: volume quota <VOLNAME> {enable|disable|list [<path> ...]| list-objects [<path> ...] | remove <path>| remove-objects <path> | default-soft-limit <percent>} |
volume quota <VOLNAME> {limit-usage <path> <size> [<percent>]} |
volume quota <VOLNAME> {limit-objects <path> <number> [<percent>]} |
volume quota <VOLNAME> {alert-time|soft-timeout|hard-timeout} {<time>}

Bug verified on build glusterfs-3.7.9-2.el7rhgs.x86_64.

Comment 15 errata-xmlrpc 2016-06-23 05:00:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1240