diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-02-04 01:20:41 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-04 22:48:30 +0300 |
commit | d9793bd8018f835c64b10f44e278c86cecb8e932 (patch) | |
tree | da5ad9bc8f3fc7b4eb4ecd398f7c52a6f112d544 /block | |
parent | ce70a0b472e06feae3a580ecb3fbef1e1e020a9b (diff) | |
download | linux-d9793bd8018f835c64b10f44e278c86cecb8e932.tar.xz |
trace: judicious error checking of trace_seq results
Impact: bugfix and cleanup
Some callsites were returning either TRACE_ITER_PARTIAL_LINE if the
trace_seq routines (trace_seq_printf, etc) returned 0 meaning its buffer
was full, or zero otherwise.
But...
/* Return values for print_line callback */
enum print_line_t {
TRACE_TYPE_PARTIAL_LINE = 0, /* Retry after flushing the seq */
TRACE_TYPE_HANDLED = 1,
TRACE_TYPE_UNHANDLED = 2 /* Relay to other output functions */
};
In other cases the return value was not being relayed at all.
Most of the time it didn't hurt because the page wasn't get filled, but
for correctness sake, handle the return values everywhere.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'block')
-rw-r--r-- | block/blktrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blktrace.c b/block/blktrace.c index 8f5c37b0f80f..12df27693972 100644 --- a/block/blktrace.c +++ b/block/blktrace.c @@ -1165,7 +1165,7 @@ static int blk_trace_event_print(struct trace_iterator *iter, int flags) const u16 what = t->action & ((1 << BLK_TC_SHIFT) - 1); int ret; - if (trace_print_context(iter)) + if (!trace_print_context(iter)) return TRACE_TYPE_PARTIAL_LINE; if (unlikely(what == 0 || what > ARRAY_SIZE(what2act))) |