Re: [PATCH] virtio_console: correct error message on failure of debugfs_create_dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 24, 2012 at 01:24:52PM -0500, Sasha Levin wrote:
> On Mon, Dec 24, 2012 at 12:39 PM, Greg Kroah-Hartman
> <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> > On Mon, Dec 24, 2012 at 11:55:46AM +0000, Arnd Bergmann wrote:
> >> On Friday 21 December 2012, Amit Shah wrote:
> >> > On (Thu) 20 Dec 2012 [14:11:21], Sasha Levin wrote:
> >> > > debugfs_create_dir() returns NULL if it fails, there's little point in
> >> > > calling PTR_ERR on it.
> >> >
> >> > debugfs_create_dir() does return an error value if debugfs is not
> >> > enabled.
> >> >
> >> > This check for !pdrvdata.debugfs_dir should infact use
> >> > IS_ERR_OR_NULL().  Care to submit a patch for that?
> >>
> >> How about we fix the stub instead to return NULL when debugfs is disabled?
> >
> > No, please read debugfs.h for why I decided to not do this (i.e. we try
> > to learn from our mistakes...)
> 
> Why won't we fix it the other way around and return an actual error
> code instead of a NULL on failure?

Again, no, that doesn't make your code simpler/faster.  You really don't
need to check the return value of debugfs, just handle it as if it
always works, and look, the code handles it all properly, no matter if
debugfs is enabled or not.  It's only debugging code, you shouldn't
really care if it is present or not, right?

If you do, perhaps you shouldn't be using debugfs?

greg k-h
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization


[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux