lightnvm: pblk: fix chunk close trace event check
authorHans Holmberg <hans.holmberg@cnexlabs.com>
Tue, 11 Dec 2018 19:16:09 +0000 (20:16 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Dec 2018 19:22:33 +0000 (12:22 -0700)
The check for chunk closes suffers from an off-by-one issue, leading
to chunk close events not being traced.

Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states")
Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/lightnvm/pblk-core.c

index 6944aac..6581c35 100644 (file)
@@ -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);
        }