Bug 1011905 - [Quota]: Input values to default-soft-limit option are not validated
Summary: [Quota]: Input values to default-soft-limit option are not validated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: glusterfs
Version: 2.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Kaushal
QA Contact: Saurabh
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-25 11:20 UTC by Sachidananda Urs
Modified: 2016-01-19 06:13 UTC (History)
7 users (show)

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.
Clone Of:
Environment:
Last Closed: 2013-11-27 15:40:45 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1769 0 normal SHIPPED_LIVE Red Hat Storage 2.1 enhancement and bug fix update #1 2013-11-27 20:17:39 UTC

Description Sachidananda Urs 2013-09-25 11:20:44 UTC
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 06:42:05 UTC
[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 15:40:45 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.

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.