lkml.org 
[lkml]   [2011]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 07/11] dynamic_debug: dont kill entire facility on error parsing ddebug_query
    Date
    Currently, a parsing error on ddebug_query results in effective loss
    of the facility; all tables are removed, and the init-call returns error.
    This is way too severe, especially when an innocent quoting error can
    be the cause:

    Kernel command line: root=LABEL=ROOT_FS ... ddebug_query='file char_dev.c +p'
    yields:

    ddebug_exec_queries: query 0: "'file"
    query before parse <'file>
    ddebug_exec_queries: processed 1 queries, with 1 errs
    Invalid ddebug boot param 'file

    Fix this by zeroing return-code for parse error before returning.

    Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
    ---
    lib/dynamic_debug.c | 5 +++--
    1 files changed, 3 insertions(+), 2 deletions(-)

    diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
    index 7cf5fa7..97f6a9b 100644
    --- a/lib/dynamic_debug.c
    +++ b/lib/dynamic_debug.c
    @@ -844,10 +844,11 @@ static int __init dynamic_debug_init(void)
    /* ddebug_query boot param got passed -> set it up */
    if (ddebug_setup_string[0] != '\0') {
    ret = ddebug_exec_queries(ddebug_setup_string);
    - if (ret)
    + if (ret) {
    + ret = 0; /* dont kill entire facility */
    pr_warning("Invalid ddebug boot param %s",
    ddebug_setup_string);
    - else
    + } else
    pr_info("ddebug initialized with string %s",
    ddebug_setup_string);
    }
    --
    1.7.4.1


    \
     
     \ /
      Last update: 2011-06-28 09:21    [W:4.614 / U:0.504 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site