lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <x49r5crp1ha.fsf@segfault.boston.devel.redhat.com>
Date:	Wed, 05 Jan 2011 14:57:53 -0500
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	Jens Axboe <jaxboe@...ionio.com>,
	Li Zefan <lizf@...fujitsu.com>, Alan.Brunelle@...com
Subject: Re: [RFC patch 1/5] trace event block fix unassigned field

Mathieu Desnoyers <mathieu.desnoyers@...icios.com> writes:

> * Jeff Moyer (jmoyer@...hat.com) wrote:
>> Mathieu Desnoyers <mathieu.desnoyers@...icios.com> writes:
>> 
>> > The "error" field in block_bio_complete is not assigned, leaving the memory area
>> > uninitialized (keeping garbage data). Initialize it to 0.
>> >
>> > We should eventually remove this field when we find out if blktrace can live
>> > without it.
>> 
>> Well, I'm fairly sure blkparse has the ability to print this field out,
>> so we should probably just fill it in properly.  Something like the
>> following untested patch should do.
>
> I updated your patch slightly (documentation and build fix). It should be fine
> now. Thanks!

Thanks a lot!

Cheers,
Jeff

> 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.
>
> From: Jeff Moyer <jmoyer@...hat.com>
> Signed-off-by: Jeff Moyer <jmoyer@...hat.com>
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
> CC: Steven Rostedt <rostedt@...dmis.org>
> CC: Frederic Weisbecker <fweisbec@...il.com>
> CC: Ingo Molnar <mingo@...e.hu>
> CC: Thomas Gleixner <tglx@...utronix.de>
> CC: Jens Axboe <jens.axboe@...cle.com>
> CC: Li Zefan <lizf@...fujitsu.com>
> CC: Alan.Brunelle@...com
> ---
>  drivers/md/dm.c              |    2 +-
>  include/trace/events/block.h |    6 ++++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> Index: linux-2.6-lttng/include/trace/events/block.h
> ===================================================================
> --- linux-2.6-lttng.orig/include/trace/events/block.h
> +++ linux-2.6-lttng/include/trace/events/block.h
> @@ -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);
>  	),
>  
> Index: linux-2.6-lttng/drivers/md/dm.c
> ===================================================================
> --- linux-2.6-lttng.orig/drivers/md/dm.c
> +++ linux-2.6-lttng/drivers/md/dm.c
> @@ -659,7 +659,7 @@ static void dec_pending(struct dm_io *io
>  			free_io(md, io);
>  
>  			if (io_error != DM_ENDIO_REQUEUE) {
> -				trace_block_bio_complete(md->queue, bio);
> +				trace_block_bio_complete(md->queue, bio, io_error);
>  
>  				bio_endio(bio, io_error);
>  			}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ