From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/7] media: usb: uvc: no need to check return value of debugfs_create functions
Date: Thu, 17 Sep 2020 14:46:00 +0200 [thread overview]
Message-ID: <20200917124600.GA3598432@kroah.com> (raw)
In-Reply-To: <20200917123757.GC3969@pendragon.ideasonboard.com>
On Thu, Sep 17, 2020 at 03:37:57PM +0300, Laurent Pinchart wrote:
> Hi Greg,
>
> On Thu, Sep 17, 2020 at 02:34:26PM +0200, Greg Kroah-Hartman wrote:
> > On Thu, Sep 17, 2020 at 03:25:50PM +0300, Laurent Pinchart wrote:
> > > On Wed, Aug 19, 2020 at 02:47:19AM +0300, Laurent Pinchart wrote:
> > > > On Tue, Aug 18, 2020 at 03:36:08PM +0200, Greg Kroah-Hartman wrote:
> > > > > When calling debugfs functions, there is no need to ever check the
> > > > > return value. The function can work or not, but the code logic should
> > > > > never do something different based on this.
> > > >
> > > > Is there no value in warning the user that something went wrong ? Silent
> > > > failures are harder to debug.
> > >
> > > Could yous share your opinion about this ?
> >
> > For debugfs, this isn't an issue, what can a user do with something like
> > "debugfs isn't working? What does that mean???"
> >
> > And if we _really_ want warnings like this, it should go into the
> > debugfs core, not require this to be done for every debugfs user, right?
> >
> > debugfs is just there for kernel developers to help debug things, it's
> > not a dependancy on any userspace functionality, so if it works or not
> > should not be an issue for any user.
> >
> > Unless that user is a kernel developer of course :)
>
> Exactly my point :-)
>
> I'm fine moving the error message to the debugfs core itself instead of
> duplicating it in drivers. Maybe it's already there though, I haven't
> checked. Not printing any message isn't a great idea in my opinion, it
> makes debugging more difficult. I can't count the number of times where
> I've had to add printk's and recompile the kernel to debug issues that
> really should have generated at least a dev_dbg().
There are a lot of error messages that debugfs will print out if it can
not create a file:
inode.c 329 pr_err("Unable to pin filesystem for file '%s'\n", name);
inode.c 348 pr_err("Directory '%s' with parent '%s' already present!\n",
inode.c 351 pr_err("File '%s' in directory '%s' already present!\n",
inode.c 402 pr_err("out of free dentries, can not create file '%s'\n",
inode.c 563 pr_err("out of free dentries, can not create directory '%s'\n",
inode.c 610 pr_err("out of free dentries, can not create automount '%s'\n",
inode.c 668 pr_err("out of free dentries, can not create symlink '%s'\n",
So I think you are safe here. If we are missing any, I'll gladly add
them.
Also given that you've never noticed this being a real error, means it's
probably not an issue :)
thanks,
greg k-h
prev parent reply other threads:[~2020-09-17 12:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 13:36 [PATCH 1/7] media: cec: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 2/7] media: coda: " Greg Kroah-Hartman
2020-08-18 13:56 ` Philipp Zabel
2020-08-18 13:36 ` [PATCH 3/7] media: exynos4-is: " Greg Kroah-Hartman
2020-08-18 13:36 ` Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 4/7] media: mtk-vpu: " Greg Kroah-Hartman
2020-08-18 13:36 ` Greg Kroah-Hartman
2020-08-18 13:36 ` Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 5/7] media: sti: " Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 6/7] media: radio: si476x: " Greg Kroah-Hartman
2020-08-18 13:36 ` [PATCH 7/7] media: usb: uvc: " Greg Kroah-Hartman
2020-08-18 23:47 ` Laurent Pinchart
2020-09-17 12:25 ` Laurent Pinchart
2020-09-17 12:34 ` Greg Kroah-Hartman
2020-09-17 12:37 ` Laurent Pinchart
2020-09-17 12:46 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200917124600.GA3598432@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.