Bug 807667 - [bfb6366bd2a6de4cb5322dda72fbc1e6ad1edc41]: opword mismatch in quota cli causes assert instead of showing usage.
[bfb6366bd2a6de4cb5322dda72fbc1e6ad1edc41]: opword mismatch in quota cli caus...
Product: GlusterFS
Classification: Community
Component: cli (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Raghavendra Bhat
Depends On:
Blocks: 817967
  Show dependency treegraph
Reported: 2012-03-28 08:51 EDT by Rahul C S
Modified: 2016-01-19 01:10 EST (History)
5 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-24 13:09:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions: 3.3.0qa45
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Rahul C S 2012-03-28 08:51:52 EDT
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	        }
616	        if (strcmp (w, "version") == 0) {
617	                type = GF_QUOTA_OPTION_TYPE_VERSION;
618	        } else {
619	                GF_ASSERT (!"opword mismatch");
620	        }
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 03:44:17 EDT
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-18 22:25:24 EDT
CHANGE: http://review.gluster.com/3363 (cli: validate quota enable/disable arguments properly) merged in master by Anand Avati (avati@redhat.com)

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