Thread (43 messages) 43 messages, 3 authors, 2025-10-10

Re: [PATCH v2 06/15] blktrace: split do_blk_trace_setup into two functions

From: Damien Le Moal <dlemoal@kernel.org>
Date: 2025-10-01 06:25:30
Also in: linux-block, lkml

On 9/26/25 00:02, Johannes Thumshirn wrote:
Split do_blk_trace_setup into two functions, this is done to prepare for
an incoming new BLKTRACESETUP2 ioctl(2) which can receive extended
parameters form user-space.
s/form/from
Also move the size verification logic to the callers.

Signed-off-by: Johannes Thumshirn <redacted>
quoted hunk ↗ jump to hunk
@@ -593,17 +581,39 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
 	debugfs_create_file("dropped", 0444, dir, bt, &blk_dropped_fops);
 	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);
+	bt->rchan = relay_open("trace", dir, buf_size, buf_nr,
+			       &blk_relay_callbacks, bt);
 	if (!bt->rchan)
 		goto err;
 
+	blk_trace_setup_lba(bt, bdev);
+
+	return bt;
+
+err:
+	if (ret)
+		blk_trace_free(q, bt);
I do not think that the "if (ret)" is needed here.
+
+	return ERR_PTR(ret);
+}
With that fixed,

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help