From b22050b50f412c4c6567eebbcd2f3364e74908d9 Mon Sep 17 00:00:00 2001 From: "Alan D. Brunelle" Date: Mon, 13 Nov 2006 14:53:37 +0100 Subject: [PATCH] [PATCH] btt: handle cases where we remap to a device which has no IO's (yet) in the trace. Fix remaps when referred to device has not been added. Signed-off-by: Alan D. Brunelle Signed-off-by: Jens Axboe --- btt/trace.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/btt/trace.c b/btt/trace.c index f44cea5..abb1488 100644 --- a/btt/trace.c +++ b/btt/trace.c @@ -58,9 +58,11 @@ void handle_remap(struct io *a_iop) struct d_info *dip = __dip_find(be32_to_cpu(rp->device)); io_setup(a_iop, IOP_A, 0); - q_iop = dip_find_sec(dip, IOP_Q, be64_to_cpu(rp->sector)); - if (q_iop) - update_q2a(q_iop, a_iop->t.time - q_iop->t.time); + if (dip) { + q_iop = dip_find_sec(dip, IOP_Q, be64_to_cpu(rp->sector)); + if (q_iop) + update_q2a(q_iop, a_iop->t.time - q_iop->t.time); + } io_release(a_iop); } -- 2.25.1