]> git.baikalelectronics.ru Git - kernel.git/commit
sunrpc: make debugfs file creation failure non-fatal
authorJeff Layton <jlayton@poochiereds.net>
Tue, 31 Mar 2015 16:03:28 +0000 (12:03 -0400)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 23 Apr 2015 18:42:27 +0000 (14:42 -0400)
commit4d005b0e927382286ca4479fce0af25e8fbb9795
tree5f9aacd13929b2e38067e8c34feb529a91696540
parent9a53a2fa06013147ad0a8a5427ea577b29901ebe
sunrpc: make debugfs file creation failure non-fatal

v2: gracefully handle the case where some dentry pointers end up NULL
    and be more dilligent about zeroing out dentry pointers

We currently have a problem that SELinux policy is being enforced when
creating debugfs files. If a debugfs file is created as a side effect of
doing some syscall, then that creation can fail if the SELinux policy
for that process prevents it.

This seems wrong. We don't do that for files under /proc, for instance,
so Bruce has proposed a patch to fix that.

While discussing that patch however, Greg K.H. stated:

    "No kernel code should care / fail if a debugfs function fails, so
     please fix up the sunrpc code first."

This patch converts all of the sunrpc debugfs setup code to be void
return functins, and the callers to not look for errors from those
functions.

This should allow rpc_clnt and rpc_xprt creation to work, even if the
kernel fails to create debugfs files for some reason.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
include/linux/sunrpc/debug.h
net/sunrpc/clnt.c
net/sunrpc/debugfs.c
net/sunrpc/sunrpc_syms.c
net/sunrpc/xprt.c