diff mbox series

[v2,12/16] lightnvm: pblk: do not read OOB from emeta region

Message ID 20190322144843.9602-13-igor.j.konopko@intel.com (mailing list archive)
State New, archived
Headers show
Series lightnvm: next set of improvements for 5.2 | expand

Commit Message

Igor Konopko March 22, 2019, 2:48 p.m. UTC
Emeta does not have corresponding OOB metadata mapping valid, so there
is no need to try to recover L2P mapping from it.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
---
 drivers/lightnvm/pblk-recovery.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Javier González March 25, 2019, 6:23 a.m. UTC | #1
> On 22 Mar 2019, at 22.48, Igor Konopko <igor.j.konopko@intel.com> wrote:
> 
> Emeta does not have corresponding OOB metadata mapping valid, so there
> is no need to try to recover L2P mapping from it.
> 
> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
> ---
> drivers/lightnvm/pblk-recovery.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index 4e8f382..74e5b17 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -479,6 +479,15 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
> 		goto retry_rq;
> 	}
> 
> +	if (paddr >= line->emeta_ssec) {
> +		/*
> +		 * We reach emeta region and we don't want
> +		 * to recover oob from emeta region.
> +		 */
> +		bio_put(bio);
> +		goto completed;
> +	}
> +
> 

This recovery path is supposed to be a last resource to recover an open
line. Since emeta_ssec is calculated based on the new state after
recovery, it is not guaranteed that the bad blocks are the same as when
the last pblk instance was interrupted. Thus, emeta_ssec is not to be
trusted.

I would rather do the full scan at this point.

Javier
Igor Konopko March 25, 2019, 11:17 a.m. UTC | #2
On 25.03.2019 07:23, Javier González wrote:
>> On 22 Mar 2019, at 22.48, Igor Konopko <igor.j.konopko@intel.com> wrote:
>>
>> Emeta does not have corresponding OOB metadata mapping valid, so there
>> is no need to try to recover L2P mapping from it.
>>
>> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
>> ---
>> drivers/lightnvm/pblk-recovery.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
>> index 4e8f382..74e5b17 100644
>> --- a/drivers/lightnvm/pblk-recovery.c
>> +++ b/drivers/lightnvm/pblk-recovery.c
>> @@ -479,6 +479,15 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>> 		goto retry_rq;
>> 	}
>>
>> +	if (paddr >= line->emeta_ssec) {
>> +		/*
>> +		 * We reach emeta region and we don't want
>> +		 * to recover oob from emeta region.
>> +		 */
>> +		bio_put(bio);
>> +		goto completed;
>> +	}
>> +
>>
> 
> This recovery path is supposed to be a last resource to recover an open
> line. Since emeta_ssec is calculated based on the new state after
> recovery, it is not guaranteed that the bad blocks are the same as when
> the last pblk instance was interrupted. Thus, emeta_ssec is not to be
> trusted.
> 
> I would rather do the full scan at this point.
> 

Ok, make sense, so we can drop this patch.

> Javier
>
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index 4e8f382..74e5b17 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -479,6 +479,15 @@  static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
 		goto retry_rq;
 	}
 
+	if (paddr >= line->emeta_ssec) {
+		/*
+		 * We reach emeta region and we don't want
+		 * to recover oob from emeta region.
+		 */
+		bio_put(bio);
+		goto completed;
+	}
+
 	pblk_get_packed_meta(pblk, rqd);
 	bio_put(bio);
 
@@ -499,6 +508,7 @@  static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
 	if (left_ppas > 0)
 		goto next_rq;
 
+completed:
 #ifdef CONFIG_NVM_PBLK_DEBUG
 	WARN_ON(padded && !pblk_line_is_full(line));
 #endif