Re: [PATCH V3] scsi: ufs-debugfs: Add error counters

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

 



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@xxxxxxxxxx>

 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux