Bug 1011905 - [Quota]: Input values to default-soft-limit option are not validated
[Quota]: Input values to default-soft-limit option are not validated
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: glusterfs (Show other bugs)
2.1
x86_64 Linux
high Severity high
: ---
: ---
Assigned To: Kaushal
Saurabh
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-25 07:20 EDT by Sachidananda Urs
Modified: 2016-01-19 01:13 EST (History)
7 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0.34rhs-1
Doc Type: Bug Fix
Doc Text:
Previously, glusterd did not perform any validation of values on a quota enabled volume. Now, glusterd validates the values and only valid percentages can be set for 'default-soft-limit' quota option.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-27 10:40:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachidananda Urs 2013-09-25 07:20:44 EDT
Description of problem:
Setting any random value on default-soft-limit for quota succeeds.

[root@boggs ~]# gluster volume quota pure_gold help
Usage: volume quota <VOLNAME> {enable|disable|list [<path> ...]|remove <path>| default-soft-limit <percent>}

As per the doc default-soft-limit takes a percent value. However any random value that is provided is set.

[root@boggs ~]# gluster volume quota pure_gold default-soft-limit -99%
volume quota : success
[root@boggs ~]# gluster volume quota pure_gold default-soft-limit :-o
volume quota : success
[root@boggs ~]# gluster vol info
 
Volume Name: pure_gold
Type: Distributed-Replicate
Volume ID: dca911c8-0fd3-44f1-b2ba-ee5a5658b0ca
Status: Started
Number of Bricks: 2 x 2 = 4
Transport-type: tcp
Bricks:
Brick1: 10.70.37.75:/rhs/brick1/r0
Brick2: 10.70.37.100:/rhs/brick1/r0
Brick3: 10.70.37.78:/rhs/brick1/r1
Brick4: 10.70.37.101:/rhs/brick1/r1
Options Reconfigured:
features.default-soft-limit: :-o
features.quota: on
performance.open-behind: enable

[root@boggs ~]# gluster volume quota pure_gold list                                                                 
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/backup-1                                 30.0MB       :-o      0Bytes  30.0MB



Version-Release number of selected component (if applicable):
3.4.0.33rhs

How reproducible:
Always

Validate soft-limit to accept values that fall in 0-100 range.
Comment 4 Gowrishankar Rajaiyan 2013-10-08 02:42:05 EDT
[root@ninja ~]# gluster volume quota vmstore default-soft-limit -99%
quota command failed : invalid percent format "-99%" in "option default-soft-limit"
[root@ninja ~]# gluster volume quota vmstore default-soft-limit :-o
quota command failed : invalid percent format ":-o" in "option default-soft-limit"
[root@ninja ~]# 


[root@ninja ~]# gluster volume quota vmstore default-soft-limit 99.999999%
volume quota : success
[root@ninja ~]# gluster volume quota vmstore list
                  Path                   Hard-limit Soft-limit   Used  Available
--------------------------------------------------------------------------------
/                                         40.0GB 99.999999%      19.2GB  20.8GB
[root@ninja ~]# 



Verified. Build: glusterfs-server-3.4.0.34rhs-1.el6rhs.x86_64
Comment 6 errata-xmlrpc 2013-11-27 10:40:45 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-1769.html

Note You need to log in before you can comment on or make changes to this bug.