public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lightnvm: fix incorrect nr_free_blocks stat
@ 2015-12-14 10:23 Chao Yu
  2015-12-14 11:42 ` Matias Bjørling
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu @ 2015-12-14 10:23 UTC (permalink / raw)
  To: mb; +Cc: linux-kernel

When initing bad block list in gennvm_block_bb, once we move bad block
from free_list to bb_list, we should maintain both stat info
nr_free_blocks and nr_bad_blocks. So this patch fixes to add missing
operation related to nr_free_blocks.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 drivers/lightnvm/gennvm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/lightnvm/gennvm.c b/drivers/lightnvm/gennvm.c
index 35dde84..6b504a2 100644
--- a/drivers/lightnvm/gennvm.c
+++ b/drivers/lightnvm/gennvm.c
@@ -89,6 +89,7 @@ static int gennvm_block_bb(struct ppa_addr ppa, int nr_blocks, u8 *blks,
 
 		list_move_tail(&blk->list, &lun->bb_list);
 		lun->vlun.nr_bad_blocks++;
+		lun->vlun.nr_free_blocks--;
 	}
 
 	return 0;
-- 
2.6.3



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

end of thread, other threads:[~2015-12-14 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-14 10:23 [PATCH] lightnvm: fix incorrect nr_free_blocks stat Chao Yu
2015-12-14 11:42 ` 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