linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lightnvm: pblk: fix chunk close trace event check
@ 2018-10-26  8:12 Hans Holmberg
  2018-10-26 18:49 ` Matias Bjørling
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Holmberg @ 2018-10-26  8:12 UTC (permalink / raw)
  To: Matias Bjorling; +Cc: linux-block, Javier Gonzales, linux-kernel, Hans Holmberg

The check for chunk closes suffers from an off-by-one issue, leading
to chunk close events not being traced. Fix this.

Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states")

Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
---

 drivers/lightnvm/pblk-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index 6944aac43b01..6581c35f51ee 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -531,7 +531,7 @@ void pblk_check_chunk_state_update(struct pblk *pblk, struct nvm_rq *rqd)
 		if (caddr == 0)
 			trace_pblk_chunk_state(pblk_disk_name(pblk),
 							ppa, NVM_CHK_ST_OPEN);
-		else if (caddr == chunk->cnlb)
+		else if (caddr == (chunk->cnlb - 1))
 			trace_pblk_chunk_state(pblk_disk_name(pblk),
 							ppa, NVM_CHK_ST_CLOSED);
 	}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-10-29 11:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-26  8:12 [PATCH] lightnvm: pblk: fix chunk close trace event check Hans Holmberg
2018-10-26 18:49 ` Matias Bjørling
2018-10-29  9:56   ` Hans Holmberg
2018-10-29 11:14     ` Matias Bjørling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).