Re: Oops in rpc_clnt_debugfs_register() from debugfs change

From: Greg Kroah-Hartman
Date: Tue Feb 12 2019 - 10:14:04 EST


On Tue, Feb 12, 2019 at 04:04:59PM +0100, Greg Kroah-Hartman wrote:
> On Tue, Feb 12, 2019 at 02:57:34PM +0000, David Howells wrote:
> > Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > - if (!xprt->debugfs) {
> > > + if (IS_ERR_OR_NULL(xprt->debugfs)) {
> >
> > That works, though I don't much like the idea of there being an error there.
> >
> > Looking in rpc_xprt_debugfs_register() there are two now-dodgy looking checks
> > on the result of debugfs calls.
>
> now-dodgy checks are fine. Well, they shouldn't matter, I've sent a
> patch that just gets rid of those checks.
>
> Ideally no one should need to check of debugfs is ok or not, the fact
> that these functions keep getting called is a bit odd, I can look into
> that some more, it shouldn't be needed...

And here's a "final" version of this, that removes all of the "dodgy"
checks, with the exception of the "is this actually a dentry" check that
my first patch had, which is still required.

Overall it makes the code smaller and simpler, but for 5.0-final, I
think my original patch should be all that is needed.

thanks,

greg k-h

-------------------------