Bug 807667 - [bfb6366bd2a6de4cb5322dda72fbc1e6ad1edc41]: opword mismatch in quota cli causes assert instead of showing usage.
Summary: [bfb6366bd2a6de4cb5322dda72fbc1e6ad1edc41]: opword mismatch in quota cli caus...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: cli
Version: pre-release
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Raghavendra Bhat
QA Contact: Saurabh
URL:
Whiteboard:
Depends On:
Blocks: 817967
TreeView+ depends on / blocked
 
Reported: 2012-03-28 12:51 UTC by Rahul C S
Modified: 2016-01-19 06:10 UTC (History)
5 users (show)

Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-24 17:09:46 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions: 3.3.0qa45
Embargoed:


Attachments (Terms of Use)

Description Rahul C S 2012-03-28 12:51:52 UTC
Description of problem:

root@Dagobah:~# gluster volume quota vol enable / 7GB 
gluster: ../../../cli/src/cli-cmd-parser.c:619: cli_cmd_quota_parse: Assertion `!"opword mismatch"' failed.
Aborted (core dumped)


backtrace of core dumped:
Core was generated by `gluster volume quota vol enable / 7GB'.
Program terminated with signal 6, Aborted.
#0  0x00007fcc8ea963a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
	in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00007fcc8ea963a5 in __GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007fcc8ea99b0b in __GI_abort () at abort.c:92
#2  0x00007fcc8ea8ed4d in __GI___assert_fail (assertion=0x43a2c0 "!\"opword mismatch\"", file=<optimized out>, line=619, 
    function=<optimized out>) at assert.c:81
#3  0x00000000004260ea in cli_cmd_quota_parse (words=0x7fffb113f200, wordcount=6, options=0x7fcc8ca74de0)
    at ../../../cli/src/cli-cmd-parser.c:619
#4  0x000000000040df1b in cli_cmd_quota_cbk (state=0x7fffb113f030, word=0x9b23a0, words=0x7fffb113f200, wordcount=6)
    at ../../../cli/src/cli-cmd-volume.c:1007
#5  0x000000000040a694 in cli_cmd_process (state=0x7fffb113f030, argc=6, argv=0x7fffb113f200) at ../../../cli/src/cli-cmd.c:150
#6  0x000000000040a0ab in cli_batch (d=0x7fffb113f030) at ../../../cli/src/input.c:44
#7  0x00007fcc8ee06efc in start_thread (arg=0x7fcc8ca75700) at pthread_create.c:304
#8  0x00007fcc8eb4189d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()
(gdb) f 3
#3  0x00000000004260ea in cli_cmd_quota_parse (words=0x7fffb113f200, wordcount=6, options=0x7fcc8ca74de0)
    at ../../../cli/src/cli-cmd-parser.c:619
619	                GF_ASSERT (!"opword mismatch");
(gdb) l
614	        }
615	
616	        if (strcmp (w, "version") == 0) {
617	                type = GF_QUOTA_OPTION_TYPE_VERSION;
618	        } else {
619	                GF_ASSERT (!"opword mismatch");
620	        }
621	
622	set_type:
623	        ret = dict_set_int32 (dict, "type", type);
(gdb) p w
$1 = 0x43a3c4 "enable"

Wrong usage of the quota cli command should show usage & not line numbers/filenames/assert messages.

Comment 2 Amar Tumballi 2012-05-18 07:44:17 UTC
RaBhat, can you test if this is the case with latest master, and send a patch fixing the issue?

Comment 3 Anand Avati 2012-05-19 02:25:24 UTC
CHANGE: http://review.gluster.com/3363 (cli: validate quota enable/disable arguments properly) merged in master by Anand Avati (avati)


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