• Arianna Avanzini's avatar
    blktrace: don't let the sysfs interface remove trace from running list · 7eca2103
    Arianna Avanzini authored
    Currently, blktrace can be started/stopped via its ioctl-based interface
    (used by the userspace blktrace tool) or via its ftrace interface. The
    function blk_trace_remove_queue(), called each time an "enable" tunable
    of the ftrace interface transitions to zero, removes the trace from the
    running list, even if no function from the sysfs interface adds it to
    such a list. This leads to a null pointer dereference.  This commit
    changes the blk_trace_remove_queue() function so that it does not remove
    the blk_trace from the running list.
    
    v2:
        - Now the patch removes the invocation of list_del() instead of
          adding an useless if branch, as suggested by Namhyung Kim.
    Signed-off-by: default avatarArianna Avanzini <avanzini.arianna@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    7eca2103
blktrace.c 42.8 KB