netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Prashant Bhole" <bhole_prashant_q7@lab.ntt.co.jp>
To: "'Jakub Kicinski'" <jakub.kicinski@netronome.com>
Cc: "'David S . Miller'" <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: RE: [PATCH net-next] netdevsim: check return value of debugfs_create_dir
Date: Thu, 7 Dec 2017 17:56:37 +0900	[thread overview]
Message-ID: <001001d36f39$4a81b5b0$df852110$@lab.ntt.co.jp> (raw)
In-Reply-To: <20171206220526.04e1bfea@cakuba.netronome.com>



> From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
> 
> On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote:
> > > From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com]
> > >
> > > On Thu,  7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote:
> > > > - Handled debugfs_create_dir failure in nsim_init()
> > > > - Fixed return value of nsim_module_init() when debugfs_create_dir
> > > > fails
> > > >
> > > > Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
> > >
> > > Why?  Failing to expose the state via DebugFS is not fatal to the
driver.
> >
> > Ok, my intention was to handle the return code properly, which is not
> > needed as per your comment.
> > Shall I remove the existing handling in nsim_module_init() in separate
> > patch?
> 
> I was going back and forth on the error handling quite a bit writing that
code.  In
> the end I decided to leave the module_init check and check for bpf prog
> directory.  Former one is mostly useful to make sure the is no duplicate
directory
> with the same name, the latter to limit possible false positive in the
selftest..

Ok. Currently return value is checked with IS_ERR(). But when Debug FS is
enabled, debugfs_create_dir will never return error value. It returns either
NULL or a valid pointer. Shall I replace IS_ERR with NULL check or
IS_ERR_OR_NULL check?

-Prashant

  reply	other threads:[~2017-12-07  9:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  1:02 [PATCH net-next] netdevsim: check return value of debugfs_create_dir Prashant Bhole
2017-12-07  2:33 ` Jakub Kicinski
2017-12-07  4:10   ` Prashant Bhole
2017-12-07  6:05     ` Jakub Kicinski
2017-12-07  8:56       ` Prashant Bhole [this message]
2017-12-07 21:20         ` Jakub Kicinski

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='001001d36f39$4a81b5b0$df852110$@lab.ntt.co.jp' \
    --to=bhole_prashant_q7@lab.ntt.co.jp \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).