Bug 1418245 - quota: inode quota cli limit-objects shouldn't accept limit-object as valid input
Summary: quota: inode quota cli limit-objects shouldn't accept limit-object as valid ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: cli
Version: rhgs-3.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: ---
Assignee: Kaushal
QA Contact: Rahul Hinduja
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-01 11:25 UTC by Anil Shah
Modified: 2017-08-24 16:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-24 16:34:04 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Anil Shah 2017-02-01 11:25:25 UTC
Description of problem:

cli to enable inode-quota is limit-objects, however cli accepts limit-object as valid input.

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

glusterfs-server-3.8.4-13.el7rhgs.x86_64

How reproducible:

100%

Steps to Reproduce:
1. create distribute-replicate volume
2. enable quota and set inode limit giving limit-object 
3. run list-object command

Actual results:

cli accepts limit-object as valid input

Expected results:

cli shouldn't accept limit-object as valid input 

Additional info:

[root@rhs-client46 /]# gluster v quota vol0 limit-object / 10
volume quota : success

[root@rhs-client46 /]# gluster v quota vol0 limit-objects / 10
volume quota : success



[root@rhs-client46 /]# gluster v quota vol0 list-object
                  Path                   Hard-limit   Soft-limit      Files       Dirs     Available  Soft-limit exceeded? Hard-limit exceeded?
-----------------------------------------------------------------------------------------------------------------------------------------------
/                                               10       80%(8)       1000         3           0             Yes                  Yes


[root@rhs-client46 /]# gluster v quota vol0 list-objects
                  Path                   Hard-limit   Soft-limit      Files       Dirs     Available  Soft-limit exceeded? Hard-limit exceeded?
-----------------------------------------------------------------------------------------------------------------------------------------------
/                                               10       80%(8)       1000         3           0             Yes                  Yes

Comment 4 Sanoj Unnikrishnan 2017-08-24 10:27:26 UTC
This is due to the way the command line is filtered/parsed.
limit-o will also get matched as limit-objects since it is the only valid command starting with "limit-o"..
Essentially any supplied command will be matched as a prefix against any valid commands. if it matches as a prefix to only one  command then it is considered as that command. 
 
Another example:
add-bri instead of add-brick.
[root@dhcp35-100 glusterfs]# gluster v add-bri v1 self:/export/b3 force
volume add-brick: success

I do not see an issue with this behaviour.


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