Re: [PATCH v3 5/6] blktrace: break out of blktrace setup on concurrent calls
From: Greg KH
Date: Fri May 01 2020 - 12:51:49 EST
On Fri, May 01, 2020 at 03:06:26PM +0000, Luis Chamberlain wrote:
> On Wed, Apr 29, 2020 at 11:49:37AM +0200, Greg KH wrote:
> > On Wed, Apr 29, 2020 at 07:46:26AM +0000, Luis Chamberlain wrote:
> > > diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
> > > index 5c52976bd762..383045f67cb8 100644
> > > --- a/kernel/trace/blktrace.c
> > > +++ b/kernel/trace/blktrace.c
> > > @@ -516,6 +518,11 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
> > > */
> > > strreplace(buts->name, '/', '_');
> > >
> > > + if (q->blk_trace) {
> > > + pr_warn("Concurrent blktraces are not allowed\n");
> > > + return -EBUSY;
> >
> > You have access to a block device here, please use dev_warn() instead
> > here for that, that makes it obvious as to what device a "concurrent
> > blktrace" was attempted for.
>
> The block device may be empty, one example is for scsi-generic, but I'll
> use buts->name.
That's fine, give us a chance to know what went wrong, your line as is
does not do that :(
thanks,
greg k-h