diff mbox

lightnvm: fix bad block initialization

Message ID 20180223174016.6104-1-hlitz@ucsc.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Heiner Litz Feb. 23, 2018, 5:40 p.m. UTC
fix reading bad block device information to correctly setup the per line
blk_bitmap during lightnvm initialization

Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
---
 drivers/lightnvm/pblk-init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Matias Bjorling Feb. 23, 2018, 6:45 p.m. UTC | #1
On 02/23/2018 06:40 PM, Heiner Litz wrote:
> fix reading bad block device information to correctly setup the per line
> blk_bitmap during lightnvm initialization
> 
> Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
> ---
>   drivers/lightnvm/pblk-init.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
> index 86a94a7faa96..e0eba150ac7e 100644
> --- a/drivers/lightnvm/pblk-init.c
> +++ b/drivers/lightnvm/pblk-init.c
> @@ -461,10 +461,11 @@ static int pblk_bb_line(struct pblk *pblk, struct pblk_line *line,
>   	struct nvm_tgt_dev *dev = pblk->dev;
>   	struct nvm_geo *geo = &dev->geo;
>   	int i, bb_cnt = 0;
> +	int blk_per_lun = geo->nr_chks * geo->plane_mode;
>   
>   	for (i = 0; i < blk_per_line; i++) {
>   		struct pblk_lun *rlun = &pblk->luns[i];
> -		u8 *lun_bb_log = bb_log + i * blk_per_line;
> +		u8 *lun_bb_log = bb_log + i * blk_per_lun;
>   
>   		if (lun_bb_log[line->id] == NVM_BLK_T_FREE)
>   			continue;
> 

Thanks Heiner. Applied.
Javier Gonzalez Feb. 24, 2018, 9:11 a.m. UTC | #2
> On 23 Feb 2018, at 19.45, Matias Bjørling <mb@lightnvm.io> wrote:
> 
> On 02/23/2018 06:40 PM, Heiner Litz wrote:
>> fix reading bad block device information to correctly setup the per line
>> blk_bitmap during lightnvm initialization
>> 
>> Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
>> ---
>>  drivers/lightnvm/pblk-init.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
>> index 86a94a7faa96..e0eba150ac7e 100644
>> --- a/drivers/lightnvm/pblk-init.c
>> +++ b/drivers/lightnvm/pblk-init.c
>> @@ -461,10 +461,11 @@ static int pblk_bb_line(struct pblk *pblk, struct pblk_line *line,
>>  	struct nvm_tgt_dev *dev = pblk->dev;
>>  	struct nvm_geo *geo = &dev->geo;
>>  	int i, bb_cnt = 0;
>> +	int blk_per_lun = geo->nr_chks * geo->plane_mode;
>> 
>>  	for (i = 0; i < blk_per_line; i++) {
>>  		struct pblk_lun *rlun = &pblk->luns[i];
>> -		u8 *lun_bb_log = bb_log + i * blk_per_line;
>> +		u8 *lun_bb_log = bb_log + i * blk_per_lun;
>> 
>>  		if (lun_bb_log[line->id] == NVM_BLK_T_FREE)
>>  			continue;
> 
> Thanks Heiner. Applied.

The patch looks good, but it is missing:

    Fixes: 36b3b712e81dc ("lightnvm: pblk: refactor bad block identification")

Matias, please add this when picking up.

Reviewed-by: Javier González <javier@cnexlabs.com>
Javier Gonzalez Feb. 24, 2018, 9:15 a.m. UTC | #3
> On 23 Feb 2018, at 19.45, Matias Bjørling <mb@lightnvm.io> wrote:
> 
> On 02/23/2018 06:40 PM, Heiner Litz wrote:
>> fix reading bad block device information to correctly setup the per line
>> blk_bitmap during lightnvm initialization
>> 
>> Signed-off-by: Heiner Litz <hlitz@ucsc.edu>
>> ---
>>  drivers/lightnvm/pblk-init.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
>> index 86a94a7faa96..e0eba150ac7e 100644
>> --- a/drivers/lightnvm/pblk-init.c
>> +++ b/drivers/lightnvm/pblk-init.c
>> @@ -461,10 +461,11 @@ static int pblk_bb_line(struct pblk *pblk, struct pblk_line *line,
>>  	struct nvm_tgt_dev *dev = pblk->dev;
>>  	struct nvm_geo *geo = &dev->geo;
>>  	int i, bb_cnt = 0;
>> +	int blk_per_lun = geo->nr_chks * geo->plane_mode;
>> 
>>  	for (i = 0; i < blk_per_line; i++) {
>>  		struct pblk_lun *rlun = &pblk->luns[i];
>> -		u8 *lun_bb_log = bb_log + i * blk_per_line;
>> +		u8 *lun_bb_log = bb_log + i * blk_per_lun;
>> 
>>  		if (lun_bb_log[line->id] == NVM_BLK_T_FREE)
>>  			continue;
> 
> Thanks Heiner. Applied.

The patch looks good, but it is missing:

   Fixes: 36b3b712e81dc ("lightnvm: pblk: refactor bad block identification")

Matias, please add this when picking up.

Reviewed-by: Javier González <javier@cnexlabs.com>


PS:
Heiner: Matias' lightnvm.io address is mb@lightnvm.io
diff mbox

Patch

diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
index 86a94a7faa96..e0eba150ac7e 100644
--- a/drivers/lightnvm/pblk-init.c
+++ b/drivers/lightnvm/pblk-init.c
@@ -461,10 +461,11 @@  static int pblk_bb_line(struct pblk *pblk, struct pblk_line *line,
 	struct nvm_tgt_dev *dev = pblk->dev;
 	struct nvm_geo *geo = &dev->geo;
 	int i, bb_cnt = 0;
+	int blk_per_lun = geo->nr_chks * geo->plane_mode;
 
 	for (i = 0; i < blk_per_line; i++) {
 		struct pblk_lun *rlun = &pblk->luns[i];
-		u8 *lun_bb_log = bb_log + i * blk_per_line;
+		u8 *lun_bb_log = bb_log + i * blk_per_lun;
 
 		if (lun_bb_log[line->id] == NVM_BLK_T_FREE)
 			continue;