public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] blktrace: fix off-by-one bug
Date: Tue, 24 Mar 2009 09:47:17 +0100	[thread overview]
Message-ID: <20090324084717.GE13016@elte.hu> (raw)
In-Reply-To: <49C89CBC.4030600@cn.fujitsu.com>


* Li Zefan <lizf@cn.fujitsu.com> wrote:

> Li Zefan wrote:
> >>> -	if (unlikely(what == 0 || what > ARRAY_SIZE(what2act)))
> >>> +	if (unlikely(what == 0 || what >= ARRAY_SIZE(what2act)))
> >> ah, nice. How did you notice - did we miss "remap" events due to 
> >> this bug?
> >>
> 
> forgot to mention, we didn't miss any "remap" events.
> 
> > 
> > By code review, but we can get NULL dereference bug if we receive an
> > "abort" event, this event may be generated only when using device-mapper.
> > 
> 
> and not NULL dereference, but accessing invalid memory.
> 
> what2act["abort"]->print(...)
> 
> and "abort" == ARRAY_SIZE(what2act).

Ah. This:

        [__BLK_TA_QUEUE]        = {{  "Q", "queue" },      blk_log_generic },
        [__BLK_TA_BACKMERGE]    = {{  "M", "backmerge" },  blk_log_generic },
        [__BLK_TA_FRONTMERGE]   = {{  "F", "frontmerge" }, blk_log_generic },
        [__BLK_TA_GETRQ]        = {{  "G", "getrq" },      blk_log_generic },
        [__BLK_TA_SLEEPRQ]      = {{  "S", "sleeprq" },    blk_log_generic },
        [__BLK_TA_REQUEUE]      = {{  "R", "requeue" },    blk_log_with_error },
        [__BLK_TA_ISSUE]        = {{  "D", "issue" },      blk_log_generic },
        [__BLK_TA_COMPLETE]     = {{  "C", "complete" },   blk_log_with_error },
        [__BLK_TA_PLUG]         = {{  "P", "plug" },       blk_log_plug },
        [__BLK_TA_UNPLUG_IO]    = {{  "U", "unplug_io" },  blk_log_unplug },
        [__BLK_TA_UNPLUG_TIMER] = {{ "UT", "unplug_timer" }, blk_log_unplug },
        [__BLK_TA_INSERT]       = {{  "I", "insert" },     blk_log_generic },
        [__BLK_TA_SPLIT]        = {{  "X", "split" },      blk_log_split },
        [__BLK_TA_BOUNCE]       = {{  "B", "bounce" },     blk_log_generic },
        [__BLK_TA_REMAP]        = {{  "A", "remap" },      blk_log_remap },

does not have a __BLK_TA_ABORT entry currently - it should have, 
right?

	Ingo

  reply	other threads:[~2009-03-24  8:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24  8:04 [PATCH 0/5] blktrace: various cleanups and fixes, part 2 Li Zefan
2009-03-24  8:04 ` [PATCH 1/5] blktrace: mark ddir_act and what2act const Li Zefan
2009-03-24 12:12   ` [tip:tracing/blktrace] blktrace: mark ddir_act[] const Li Zefan
2009-03-24 12:49   ` [PATCH 1/5] blktrace: mark ddir_act and what2act const Arnaldo Carvalho de Melo
2009-03-24  8:05 ` [PATCH 2/5] blktrace: fix wrong calculation of RWBS Li Zefan
2009-03-24 12:12   ` [tip:tracing/blktrace] " Li Zefan
2009-03-24  8:05 ` [PATCH 3/5] blktrace: fix off-by-one bug Li Zefan
2009-03-24  8:27   ` Ingo Molnar
2009-03-24  8:33     ` Li Zefan
2009-03-24  8:41       ` Li Zefan
2009-03-24  8:47         ` Ingo Molnar [this message]
2009-03-24  8:50           ` Li Zefan
2009-03-25  1:21   ` Li Zefan
2009-03-25 13:15   ` [tip:tracing/blktrace] " Li Zefan
2009-03-24  8:05 ` [PATCH 4/5] blktrace: fix t_error() Li Zefan
2009-03-24  8:44   ` Ingo Molnar
2009-03-24 12:12   ` [tip:tracing/blktrace] " Li Zefan
2009-03-24 12:51   ` [PATCH 4/5] " Arnaldo Carvalho de Melo
2009-03-24  8:06 ` [PATCH 5/5] blktrace: print human-readable act_mask Li Zefan
2009-03-24  8:39   ` Ingo Molnar
2009-03-24  9:01     ` Li Zefan
2009-03-24  8:39   ` Ingo Molnar
2009-03-24  8:46     ` Li Zefan
2009-03-24  9:43   ` Li Zefan
2009-03-24  9:48     ` Ingo Molnar
2009-03-24 12:12     ` [tip:tracing/blktrace] " Li Zefan
2009-03-24 15:48   ` [PATCH 5/5] " Steven Rostedt
2009-03-24 15:49   ` Steven Rostedt
2009-03-24 15:56     ` Ingo Molnar
2009-03-24 16:04       ` Steven Rostedt
2009-03-24 16:06         ` Steven Rostedt
2009-03-25  2:55           ` Li Zefan
2009-03-24 11:49 ` [PATCH 0/5] blktrace: various cleanups and fixes, part 2 Jens Axboe
2009-03-24 12:10   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090324084717.GE13016@elte.hu \
    --to=mingo@elte.hu \
    --cc=acme@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox