Thread (33 messages) 33 messages, 6 authors, 2020-05-04

Re: [PATCH v3 5/6] blktrace: break out of blktrace setup on concurrent calls

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2020-05-01 16:51:51
Also in: linux-fsdevel, linux-mm, lkml

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:
quoted
On Wed, Apr 29, 2020 at 07:46:26AM +0000, Luis Chamberlain wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help