dlm: fix malfunction of dlm_tool caused by debugfs changes
authorEric Ren <zren@suse.com>
Thu, 25 Aug 2016 09:20:59 +0000 (17:20 +0800)
committerDavid Teigland <teigland@redhat.com>
Fri, 26 Aug 2016 18:22:14 +0000 (13:22 -0500)
commit079d37df3397d48aab0f014986c1b0a1ca6256aa
treeee64358c7af2b4a5ffab8206ad41760ca5e829dc
parentfa8410b355251fd30341662a40ac6b22d3e38468
dlm: fix malfunction of dlm_tool caused by debugfs changes

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 49d200deaa68 ("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: Eric Ren <zren@suse.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/debug_fs.c