mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>, Can Guo <cang@codeaurora.org>,
	Stanley Chu <stanley.chu@mediatek.com>
Subject: Re: [PATCH V3] scsi: ufs-debugfs: Add error counters
Date: Fri, 18 Dec 2020 19:57:55 +0100	[thread overview]
Message-ID: <2ce8e183f03855af6c16b2a555473cca3fbbfef6.camel@gmail.com> (raw)
In-Reply-To: <17957d71-d45b-d5f6-8ef2-453402a23268@intel.com>

On Fri, 2020-12-18 at 20:34 +0200, Adrian Hunter wrote:
> It is OK to pass NULL or error codes as parent dentry to
> debugfs_create_...
> functions.
> 
> If ufs_debugfs_root is NULL (which won't happen) then the directory
> will be
> created in debugfs root i.e. /sys/kernel/debug, using the device
> name.
> 
> If ufs_debugfs_root is an error code, then debugfs_create_dir will
> return an
> error code, and following debugfs_create_file() will return an error
> code.
> 
> > 
> > > +    debugfs_create_file("stats", 0400, hba->debugfs_root, hba,
> > > &ufs_debugfs_stats_fops);
> > 
> >        if (!debugfs_create_file("stats", 0400, hba->debugfs_root,
> > hba,
> >                &ufs_debugfs_stats_fops)) {
> >                debugfs_remove(hba->debugfs_root);
> >                return -ENOMEM;
> 
> Being without debugfs files is not a problem, so there is no reason
> to
> return an error.  It is relatively rare in the kernel that code
> checks the
> return value of debugfs_create_file().  We really don't want to fail
> probing
> just because of debugfs.
> 
> However, because debugfs' only real resource is a small amount of
> memory, it
> is extremely unlikely it will fail in that sense.  Although you can
> force it
> to fail by adding the kernel command line parameter debugfs=off

Adrian
Sounds your choice is correct. thanks.

Reviewed-by: Bean Huo <beanhuo@micron.com>

 


      reply	other threads:[~2020-12-18 18:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 12:20 Adrian Hunter
2020-12-18 15:17 ` Bean Huo
2020-12-18 18:34   ` Adrian Hunter
2020-12-18 18:57     ` Bean Huo [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=2ce8e183f03855af6c16b2a555473cca3fbbfef6.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=cang@codeaurora.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    /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

Powered by JetHome