• Eric Ren's avatar
    dlm: fix malfunction of dlm_tool caused by debugfs changes · 079d37df
    Eric Ren authored
    With the current kernel, `dlm_tool lockdebug` fails as below:
    
    "dlm_tool lockdebug ED0BD86DCE724393918A1AE8FDBF1EE3
    can't open /sys/kernel/debug/dlm/ED0BD86DCE724393918A1AE8FDBF1EE3:
    Operation not permitted"
    
    This is because table_open() depends on file->f_op to tell which
    seq_file ops should be passed down. But, the original file ops in
    file->f_op is replaced by "debugfs_full_proxy_file_operations" with
    commit 49d200de ("debugfs: prevent access to removed files'
    private data").
    
    Currently, I can think up 2 solutions: 1st, replace
    debugfs_create_file() with debugfs_create_file_unsafe();
    2nd, make different table_open#() accordingly. The 1st one
    is neat, but I don't thoroughly understand its risk. Maybe
    someone has a better one.
    Signed-off-by: default avatarEric Ren <zren@suse.com>
    Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
    079d37df
debug_fs.c 18.5 KB