Skip to contentSkip to conversation

lightnvm: fix incorrect nr_free_blocks stat

PATCH In review Chao Yu 2 participants 2 messages Dec 14, 2015

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 lightnvm: fix incorrect nr_free_blocks stat

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.

---
 drivers/lightnvm/gennvm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/lightnvm/gennvm.c +1 -0
index 35dde84..6b504a2 100644
@@ -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;
Signature · 1 line
2.6.3
#1 lore raw
Quoted 16 lines · Chao Yu

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.

---
  drivers/lightnvm/gennvm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/lightnvm/gennvm.c +0 -0
index 35dde84..6b504a2 100644

drivers/lightnvm/gennvm.c static int gennvm_block_bb(struct ppa_addr ppa, int nr_blocks, u8 *blks, · line 95

Quoted 7 lines
drivers/lightnvm/gennvm.c +1 -0
@@ -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;

Thanks Yu, Applied.