From f719268ef8a8cc35b415d0aa99761b6893f643be Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Wed, 8 May 2019 12:01:11 +0200 Subject: [PATCH] lib/ftl: trace RWB fill before advancing IO position This fixes incorrect LBA reported by traces (it reported the next one, as the IO position was advanced before storing the trace). Change-Id: I788853d729dd25e90c6c899be0616aa3a79d08b3 Signed-off-by: Konrad Sztyber Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453681 Tested-by: SPDK CI Jenkins Reviewed-by: Darek Stojaczyk Reviewed-by: Jim Harris --- lib/ftl/ftl_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ftl/ftl_core.c b/lib/ftl/ftl_core.c index e1bdea73c..83687bca2 100644 --- a/lib/ftl/ftl_core.c +++ b/lib/ftl/ftl_core.c @@ -1279,6 +1279,7 @@ ftl_rwb_fill(struct ftl_io *io) ppa.offset = entry->pos; + ftl_trace_rwb_fill(dev, io); ftl_io_advance(io, 1); ftl_update_l2p(dev, entry, ppa); @@ -1286,7 +1287,6 @@ ftl_rwb_fill(struct ftl_io *io) /* write completion callback when it's processed faster than */ /* L2P is set in update_l2p(). */ ftl_rwb_push(entry); - ftl_trace_rwb_fill(dev, io); } ftl_io_complete(io);