Re: [PATCH v2 07/10] blktrace: move debugfs file creation to its own function

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

 



On Sun, Apr 19, 2020 at 03:55:15PM -0700, Bart Van Assche wrote:
> On 4/19/20 12:45 PM, Luis Chamberlain wrote:
> > +static int blk_trace_create_debugfs_files(struct blk_user_trace_setup *buts,
> > +					  struct dentry *dir,
> > +					  struct blk_trace *bt)
> > +{
> > +	int ret = -EIO;
> > +
> > +	bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
> > +					       &blk_dropped_fops);
> > +
> > +	bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
> > +
> > +	bt->rchan = relay_open("trace", dir, buts->buf_size,
> > +				buts->buf_nr, &blk_relay_callbacks, bt);
> > +	if (!bt->rchan)
> > +		return ret;
> > +
> > +	return 0;
> > +}
> 
> How about adding IS_ERR() checks for the debugfs_create_file() return
> values?

No, please no, I have been removing all of that nonsense from the kernel
for the past 3-4 releases.  You should never care about the return value
from that call, just save it off and move on.

as it is, this is correct.

greg k-h



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux