Skip to contentSkip to conversation

lightnvm: do not reserve lun on l2p loading

PATCH In review Javier González 2 participants 2 messages Feb 17, 2016 – Feb 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lightnvm: do not reserve lun on l2p loading

When the l2p table is loaded, addresses are checked for the lun they belong to and luns are reserved accordingly. This assumes that metadata is being stored in the backend device to recover the previous target configuration. Since this is not yet implemented, this check collides with some of the core initialization (e.g., sysblock initialization when a page is formed by several sectors).

We take this check out and for now rely on that the right target will be created instead. When metadata is stored to recover a target, this check will come natural as aprt of the recovery strategy.

FIXES c87ea75

---
 drivers/lightnvm/gennvm.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/lightnvm/gennvm.c +0 -3
index b97801c..42c1c2a 100644
@@ -192,9 +192,6 @@ static int gennvm_block_map(u64 slba, u32 nlb, __le64 *entries, void *private)
 		lun_id = div_u64(pba, dev->sec_per_lun);
 		lun = &gn->luns[lun_id];
 
-		if (!test_bit(lun_id, dev->lun_map))
-			__set_bit(lun_id, dev->lun_map);
-
 		/* Calculate block offset into lun */
 		pba = pba - (dev->sec_per_lun * lun_id);
 		blk = &lun->vlun.blocks[div_u64(pba, dev->sec_per_blk)];
Signature · 1 line
2.1.4
#1 lore raw
Quoted 24 lines · Javier González

When the l2p table is loaded, addresses are checked for the lun they belong to and luns are reserved accordingly. This assumes that metadata is being stored in the backend device to recover the previous target configuration. Since this is not yet implemented, this check collides with some of the core initialization (e.g., sysblock initialization when a page is formed by several sectors).

We take this check out and for now rely on that the right target will be created instead. When metadata is stored to recover a target, this check will come natural as aprt of the recovery strategy.

FIXES c87ea75

---
  drivers/lightnvm/gennvm.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/lightnvm/gennvm.c +0 -0
index b97801c..42c1c2a 100644

drivers/lightnvm/gennvm.c static int gennvm_block_map(u64 slba, u32 nlb, __le64 *entries, void *private) · line 197

Quoted 9 lines
drivers/lightnvm/gennvm.c +0 -3
@@ -192,9 +192,6 @@ static int gennvm_block_map(u64 slba, u32 nlb, __le64 *entries, void *private)
  		lun_id = div_u64(pba, dev->sec_per_lun);
  		lun = &gn->luns[lun_id];
 
-		if (!test_bit(lun_id, dev->lun_map))
-			__set_bit(lun_id, dev->lun_map);
-
  		/* Calculate block offset into lun */
  		pba = pba - (dev->sec_per_lun * lun_id);
  		blk = &lun->vlun.blocks[div_u64(pba, dev->sec_per_blk)];

Thanks Javier, applied.

-Matias