diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-02 01:43:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-03 09:29:26 -0400 |
commit | e2494e1b42ebac402324105d57646489d19e2b01 (patch) | |
tree | bd8d0beac5d8b8a7e6ff209c265b015a56fed1fd | |
parent | 7635b03adf3d7b84da7649b81efa91e6ebf11b85 (diff) |
blktrace: fix pdu_len when tracing packet command requests
Impact: output all of packet commands - not just the first 4 / 8 bytes
Since commit d7e3c3249ef23b4617393c69fe464765b4ff1645 ("block: add
large command support"), struct request->cmd has been changed from
unsinged char cmd[BLK_MAX_CDB] to unsigned char *cmd.
v1 -> v2: by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- make sure rq->cmd_len is always intialized, and then we can use
rq->cmd_len instead of BLK_MAX_CDB.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
LKML-Reference: <49D4507E.2060602@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | block/blk-core.c | 1 | ||||
-rw-r--r-- | kernel/trace/blktrace.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 29bcfac6c688..859879d0a0bf 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -132,6 +132,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq) | |||
132 | INIT_HLIST_NODE(&rq->hash); | 132 | INIT_HLIST_NODE(&rq->hash); |
133 | RB_CLEAR_NODE(&rq->rb_node); | 133 | RB_CLEAR_NODE(&rq->rb_node); |
134 | rq->cmd = rq->__cmd; | 134 | rq->cmd = rq->__cmd; |
135 | rq->cmd_len = BLK_MAX_CDB; | ||
135 | rq->tag = -1; | 136 | rq->tag = -1; |
136 | rq->ref_count = 1; | 137 | rq->ref_count = 1; |
137 | } | 138 | } |
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 73d7860b72e2..b32ff446c3fb 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -643,7 +643,7 @@ static void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
643 | if (blk_pc_request(rq)) { | 643 | if (blk_pc_request(rq)) { |
644 | what |= BLK_TC_ACT(BLK_TC_PC); | 644 | what |= BLK_TC_ACT(BLK_TC_PC); |
645 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, | 645 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, |
646 | sizeof(rq->cmd), rq->cmd); | 646 | rq->cmd_len, rq->cmd); |
647 | } else { | 647 | } else { |
648 | what |= BLK_TC_ACT(BLK_TC_FS); | 648 | what |= BLK_TC_ACT(BLK_TC_FS); |
649 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | 649 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, |