Bug 765147 (GLUSTER-3415)

Summary: option handling cleanup
Product: [Community] GlusterFS Reporter: Anand Avati <aavati>
Component: coreAssignee: Anand Avati <aavati>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: mainlineCC: amarts, chrisw, gluster-bugs, shylesh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Anand Avati 2011-08-15 19:31:48 UTC
clean up option handling

- remove redundant code
- remove duplicate code
- fix copy/paste errors
- fix logical errors

Comment 1 Anand Avati 2011-08-19 03:49:05 UTC
CHANGE: http://review.gluster.com/235 (- move option handling to options.c (new file)) merged in master by Anand Avati (avati)

Comment 2 Anand Avati 2011-08-19 07:06:21 UTC
CHANGE: http://review.gluster.com/261 (fixes in option handling changes) merged in master by Anand Avati (avati)

Comment 3 Amar Tumballi 2011-08-19 14:04:22 UTC
This fix has bought in a crash.


#0  0x00007f18d2142a75 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f18d21465c0 in *__GI_abort () at abort.c:92
#2  0x00007f18d213b941 in *__GI___assert_fail (assertion=0x7f18d2d6866d "0", file=<value optimized out>, line=90, 
    function=0x7f18d2d687b0 "gf_mem_set_acct_info") at assert.c:81
#3  0x00007f18d2d44973 in gf_mem_set_acct_info (xl=0x1d64ba0, alloc_ptr=0x7fffcb1d86d0, size=83, type=39)
    at ../../../libglusterfs/src/mem-pool.c:90
#4  0x00007f18d2d44d51 in __gf_malloc (size=83, type=39) at ../../../libglusterfs/src/mem-pool.c:172
#5  0x00007f18d2d44f42 in gf_vasprintf (string_ptr=0x7fffcb1d8908, format=0x7f18d2d64d69 "[%s] %s [%s:%d:%s] %d-%s: ", 
    arg=0x7fffcb1d8780) at ../../../libglusterfs/src/mem-pool.c:226
#6  0x00007f18d2d4505f in gf_asprintf (string_ptr=0x7fffcb1d8908, format=0x7f18d2d64d69 "[%s] %s [%s:%d:%s] %d-%s: ")
    at ../../../libglusterfs/src/mem-pool.c:244
#7  0x00007f18d2d1755a in _gf_log (domain=0x1d647f0 "test-server", file=0x7f18d2d69de0 "../../../libglusterfs/src/graph.c", 
    function=0x7f18d2d6a160 "_log_if_unknown_option", line=347, level=GF_LOG_WARNING, 
    fmt=0x7f18d2d69f57 "option '%s' is not recognized") at ../../../libglusterfs/src/logging.c:541
#8  0x00007f18d2d51ba5 in _log_if_unknown_option (dict=0x1d65510, key=0x1d65930 "auth.addr./tmp/export/r3.allow", 
    value=0x1d65880, data=0x1d64ba0) at ../../../libglusterfs/src/graph.c:346
#9  0x00007f18d2d0cbff in dict_foreach (dict=0x1d65510, fn=0x7f18d2d51aff <_log_if_unknown_option>, data=0x1d64ba0)
    at ../../../libglusterfs/src/dict.c:1218
#10 0x00007f18d2d51bd2 in _xlator_check_unknown_options (xl=0x1d64ba0, data=0x0) at ../../../libglusterfs/src/graph.c:357
#11 0x00007f18d2d14f16 in xlator_foreach (this=0x1d64ba0, fn=0x7f18d2d51ba7 <_xlator_check_unknown_options>, data=0x0)
    at ../../../libglusterfs/src/xlator.c:318
#12 0x00007f18d2d51bff in glusterfs_graph_unknown_options (graph=0x1d46490) at ../../../libglusterfs/src/graph.c:364
#13 0x00000000004093c7 in glusterfs_volfile_reconfigure (newvolfile_fp=0x1d2f920)
    at ../../../glusterfsd/src/glusterfsd-mgmt.c:607
#14 0x000000000040963e in mgmt_getspec_cbk (req=0x7f18d060f288, iov=0x7f18d060f2c8, count=1, myframe=0x7f18d13b4200)
    at ../../../glusterfsd/src/glusterfsd-mgmt.c:673
#15 0x00007f18d2aee068 in rpc_clnt_handle_reply (clnt=0x1d2cb10, pollin=0x1d46b10)
    at ../../../../rpc/rpc-lib/src/rpc-clnt.c:747


----
(gdb) up
#3  0x00007f18d2d44973 in gf_mem_set_acct_info (xl=0x1d64ba0, alloc_ptr=0x7fffcb1d86d0, size=83, type=39)
    at ../../../libglusterfs/src/mem-pool.c:90
90	                GF_ASSERT (0);
(gdb) l
85	        if (!xl) {
86	                GF_ASSERT (0);
87	        }
88	
89	        if (!(xl->mem_acct.rec)) {
90	                GF_ASSERT (0);
91	        }
92	
93	        if (type > xl->mem_acct.num_types) {
94	                GF_ASSERT (0);
(gdb) p type
$7 = 39
(gdb) p xl->mem_acct
$8 = {num_types = 0, rec = 0x0}
----

the last minute change in the patch to add 'unknown_options()' in reconfigure on new graph has created this problem, as there is no 'init()' on the newgraph yet.

Comment 4 Anand Avati 2011-08-20 03:16:45 UTC
CHANGE: http://review.gluster.com/271 (last minute change broke things. undo'ing damage.) merged in master by Vijay Bellur (vijay)

Comment 5 Anand Avati 2011-08-20 07:08:20 UTC
CHANGE: http://review.gluster.com/274 (Change-Id: I585e8e685f5c23b6fa632ef708adf2e349ba6704) merged in master by Vijay Bellur (vijay)

Comment 6 Anand Avati 2011-08-20 08:47:17 UTC
CHANGE: http://review.gluster.com/277 (Change-Id: Ifad5827c6b022de7d84e081ce77effda0c245a13) merged in master by Vijay Bellur (vijay)

Comment 7 Anand Avati 2011-08-21 08:12:33 UTC
CHANGE: http://review.gluster.com/284 (Change-Id: I8e5b8841705b161068bdb2ccd2ac119d6b250c88) merged in master by Vijay Bellur (vijay)

Comment 8 Anand Avati 2011-08-21 10:09:47 UTC
CHANGE: http://review.gluster.com/287 (Change-Id: I5aa6ee7509a8f730ca64e2f7bada56d502785a6c) merged in master by Vijay Bellur (vijay)

Comment 9 Anand Avati 2011-08-21 10:28:20 UTC
CHANGE: http://review.gluster.com/288 (Change-Id: Ic227781760a5f6dbf8aad69a19f90e45d4aaec13) merged in master by Vijay Bellur (vijay)

Comment 10 shylesh 2011-09-28 07:21:38 UTC
This is related to source code enhancements and not exposed to user level functionality hence marking as verified