diff mbox series

[05/18] lightnvm: pblk: propagate errors when reading meta

Message ID 20190314160428.3559-6-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 14, 2019, 4:04 p.m. UTC
Currently when smeta/emeta/oob is read errors are not always propagated
correctly. This patch changes that behaviour and propagates all the
error codes except of high ecc read warning status.

Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
---
 drivers/lightnvm/pblk-core.c     | 9 +++++++--
 drivers/lightnvm/pblk-recovery.c | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

Comments

Javier González March 16, 2019, 10:48 p.m. UTC | #1
> On 14 Mar 2019, at 09.04, Igor Konopko <igor.j.konopko@intel.com> wrote:
> 
> Currently when smeta/emeta/oob is read errors are not always propagated
> correctly. This patch changes that behaviour and propagates all the
> error codes except of high ecc read warning status.
> 
> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
> ---
> drivers/lightnvm/pblk-core.c     | 9 +++++++--
> drivers/lightnvm/pblk-recovery.c | 2 +-
> 2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index 39280c1..38e26fe 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -761,8 +761,10 @@ int pblk_line_smeta_read(struct pblk *pblk, struct pblk_line *line)
> 
> 	atomic_dec(&pblk->inflight_io);
> 
> -	if (rqd.error)
> +	if (rqd.error && rqd.error != NVM_RSP_WARN_HIGHECC) {
> 		pblk_log_read_err(pblk, &rqd);
> +		ret = -EIO;
> +	}
> 
> clear_rqd:
> 	pblk_free_rqd_meta(pblk, &rqd);
> @@ -916,8 +918,11 @@ int pblk_line_emeta_read(struct pblk *pblk, struct pblk_line *line,
> 
> 	atomic_dec(&pblk->inflight_io);
> 
> -	if (rqd.error)
> +	if (rqd.error && rqd.error != NVM_RSP_WARN_HIGHECC) {
> 		pblk_log_read_err(pblk, &rqd);
> +		ret = -EIO;
> +		goto free_rqd_dma;
> +	}
> 
> 	emeta_buf += rq_len;
> 	left_ppas -= rq_ppas;
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index bcd3633..688fdeb 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -450,7 +450,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
> 	atomic_dec(&pblk->inflight_io);
> 
> 	/* If a read fails, do a best effort by padding the line and retrying */
> -	if (rqd->error) {
> +	if (rqd->error && rqd->error != NVM_RSP_WARN_HIGHECC) {
> 		int pad_distance, ret;
> 
> 		if (padded) {
> --
> 2.9.5


Looks good to me.

Reviewed-by: Javier González <javier@javigon.com>
Hans Holmberg March 18, 2019, 11:54 a.m. UTC | #2
Nice!

Reviewed-by: Hans Holmberg <hans.holmberg@cnexlabs.com>

On Thu, Mar 14, 2019 at 5:07 PM Igor Konopko <igor.j.konopko@intel.com> wrote:
>
> Currently when smeta/emeta/oob is read errors are not always propagated
> correctly. This patch changes that behaviour and propagates all the
> error codes except of high ecc read warning status.
>
> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
> ---
>  drivers/lightnvm/pblk-core.c     | 9 +++++++--
>  drivers/lightnvm/pblk-recovery.c | 2 +-
>  2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
> index 39280c1..38e26fe 100644
> --- a/drivers/lightnvm/pblk-core.c
> +++ b/drivers/lightnvm/pblk-core.c
> @@ -761,8 +761,10 @@ int pblk_line_smeta_read(struct pblk *pblk, struct pblk_line *line)
>
>         atomic_dec(&pblk->inflight_io);
>
> -       if (rqd.error)
> +       if (rqd.error && rqd.error != NVM_RSP_WARN_HIGHECC) {
>                 pblk_log_read_err(pblk, &rqd);
> +               ret = -EIO;
> +       }
>
>  clear_rqd:
>         pblk_free_rqd_meta(pblk, &rqd);
> @@ -916,8 +918,11 @@ int pblk_line_emeta_read(struct pblk *pblk, struct pblk_line *line,
>
>         atomic_dec(&pblk->inflight_io);
>
> -       if (rqd.error)
> +       if (rqd.error && rqd.error != NVM_RSP_WARN_HIGHECC) {
>                 pblk_log_read_err(pblk, &rqd);
> +               ret = -EIO;
> +               goto free_rqd_dma;
> +       }
>
>         emeta_buf += rq_len;
>         left_ppas -= rq_ppas;
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index bcd3633..688fdeb 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -450,7 +450,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>         atomic_dec(&pblk->inflight_io);
>
>         /* If a read fails, do a best effort by padding the line and retrying */
> -       if (rqd->error) {
> +       if (rqd->error && rqd->error != NVM_RSP_WARN_HIGHECC) {
>                 int pad_distance, ret;
>
>                 if (padded) {
> --
> 2.9.5
>
diff mbox series

Patch

diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c
index 39280c1..38e26fe 100644
--- a/drivers/lightnvm/pblk-core.c
+++ b/drivers/lightnvm/pblk-core.c
@@ -761,8 +761,10 @@  int pblk_line_smeta_read(struct pblk *pblk, struct pblk_line *line)
 
 	atomic_dec(&pblk->inflight_io);
 
-	if (rqd.error)
+	if (rqd.error && rqd.error != NVM_RSP_WARN_HIGHECC) {
 		pblk_log_read_err(pblk, &rqd);
+		ret = -EIO;
+	}
 
 clear_rqd:
 	pblk_free_rqd_meta(pblk, &rqd);
@@ -916,8 +918,11 @@  int pblk_line_emeta_read(struct pblk *pblk, struct pblk_line *line,
 
 	atomic_dec(&pblk->inflight_io);
 
-	if (rqd.error)
+	if (rqd.error && rqd.error != NVM_RSP_WARN_HIGHECC) {
 		pblk_log_read_err(pblk, &rqd);
+		ret = -EIO;
+		goto free_rqd_dma;
+	}
 
 	emeta_buf += rq_len;
 	left_ppas -= rq_ppas;
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index bcd3633..688fdeb 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -450,7 +450,7 @@  static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
 	atomic_dec(&pblk->inflight_io);
 
 	/* If a read fails, do a best effort by padding the line and retrying */
-	if (rqd->error) {
+	if (rqd->error && rqd->error != NVM_RSP_WARN_HIGHECC) {
 		int pad_distance, ret;
 
 		if (padded) {