Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7908c10 authored by Jeff Moyer's avatar Jeff Moyer Committed by Jens Axboe
Browse files

block: trace event block fix unassigned field



The "error" field in block_bio_complete is not assigned, leaving the memory area
uninitialized (keeping garbage data). Pass an additional tracepoint argument to
this event to initialize this field.

Signed-off-by: default avatarJeff Moyer <jmoyer@redhat.com>
Signed-off-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Li Zefan <lizf@cn.fujitsu.com>
CC: Alan.Brunelle@hp.com
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 6c23a968
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -630,7 +630,7 @@ static void dec_pending(struct dm_io *io, int error)
			queue_io(md, bio);
		} else {
			/* done with normal IO or empty flush */
			trace_block_bio_complete(md->queue, bio);
			trace_block_bio_complete(md->queue, bio, io_error);
			bio_endio(bio, io_error);
		}
	}
+4 −2
Original line number Diff line number Diff line
@@ -206,15 +206,16 @@ TRACE_EVENT(block_bio_bounce,
 * block_bio_complete - completed all work on the block operation
 * @q: queue holding the block operation
 * @bio: block operation completed
 * @error: io error value
 *
 * This tracepoint indicates there is no further work to do on this
 * block IO operation @bio.
 */
TRACE_EVENT(block_bio_complete,

	TP_PROTO(struct request_queue *q, struct bio *bio),
	TP_PROTO(struct request_queue *q, struct bio *bio, int error),

	TP_ARGS(q, bio),
	TP_ARGS(q, bio, error),

	TP_STRUCT__entry(
		__field( dev_t,		dev		)
@@ -228,6 +229,7 @@ TRACE_EVENT(block_bio_complete,
		__entry->dev		= bio->bi_bdev->bd_dev;
		__entry->sector		= bio->bi_sector;
		__entry->nr_sector	= bio->bi_size >> 9;
		__entry->error		= error;
		blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
	),