Skip to content

Commit ad6fef7

Browse files
gregkhamschuma-ntap
authored andcommitted
rpc: properly check debugfs dentry before using it
debugfs can now report an error code if something went wrong instead of just NULL. So if the return value is to be used as a "real" dentry, it needs to be checked if it is an error before dereferencing it. This is now happening because of ff9fb72 ("debugfs: return error values, not NULL"), but why debugfs files are not being created properly is an older issue, probably one that has always been there and should probably be looked at... Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Jeff Layton <jlayton@kernel.org> Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org Reported-by: David Howells <dhowells@redhat.com> Tested-by: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent a4cb5bd commit ad6fef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
146146
rcu_read_lock();
147147
xprt = rcu_dereference(clnt->cl_xprt);
148148
/* no "debugfs" dentry? Don't bother with the symlink. */
149-
if (!xprt->debugfs) {
149+
if (IS_ERR_OR_NULL(xprt->debugfs)) {
150150
rcu_read_unlock();
151151
return;
152152
}

0 commit comments

Comments
 (0)