linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Holmberg <hans.ml.holmberg@owltronix.com>
To: zjwu@marvell.com
Cc: Matias Bjorling <mb@lightnvm.io>,
	Javier Gonzalez <javier@cnexlabs.com>,
	linux-block@vger.kernel.org, hongd@marvell.com
Subject: Re: [PATCH] lightnvm: pblk: ignore the smeta oob area scan
Date: Thu, 25 Oct 2018 13:16:38 +0200	[thread overview]
Message-ID: <CANr-nt2bHSPhpRprvYcb1L-rhPFri0Cm2YBWdV+6AHe1Mk3mMw@mail.gmail.com> (raw)
In-Reply-To: <1540428404-30196-1-git-send-email-zjwu@marvell.com>

On Thu, Oct 25, 2018 at 2:44 AM Zhoujie Wu <zjwu@marvell.com> wrote:
>
> The smeta area l2p mapping is empty, and actually the
> recovery procedure only need to restore data sector's l2p
> mapping. So ignore the smeta oob scan.
>
> Signed-off-by: Zhoujie Wu <zjwu@marvell.com>
> ---
>  drivers/lightnvm/pblk-recovery.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
> index 5740b75..30f2616 100644
> --- a/drivers/lightnvm/pblk-recovery.c
> +++ b/drivers/lightnvm/pblk-recovery.c
> @@ -334,6 +334,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>                                struct pblk_recov_alloc p)
>  {
>         struct nvm_tgt_dev *dev = pblk->dev;
> +       struct pblk_line_meta *lm = &pblk->lm;
>         struct nvm_geo *geo = &dev->geo;
>         struct ppa_addr *ppa_list;
>         struct pblk_sec_meta *meta_list;
> @@ -342,12 +343,12 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct pblk_line *line,
>         void *data;
>         dma_addr_t dma_ppa_list, dma_meta_list;
>         __le64 *lba_list;
> -       u64 paddr = 0;
> +       u64 paddr = lm->smeta_sec;

Smeta is not guaranteed to start at paddr 0 - it will be placed in the
first non-bad chunk (in stripe order).
If the first chunk in the line is bad, smeta will be read and
lm->smeta_sec sectors will be lost.

You can use pblk_line_smeta_start to calculate the start address of smeta.

/ Hans

>         bool padded = false;
>         int rq_ppas, rq_len;
>         int i, j;
>         int ret;
> -       u64 left_ppas = pblk_sec_in_open_line(pblk, line);
> +       u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec;
>
>         if (pblk_line_wp_is_unbalanced(pblk, line))
>                 pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id);
> --
> 1.9.1
>

  reply	other threads:[~2018-10-25 19:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25  0:46 [PATCH] lightnvm: pblk: ignore the smeta oob area scan Zhoujie Wu
2018-10-25 11:16 ` Hans Holmberg [this message]
2018-10-25 23:12   ` [EXT] " Zhoujie Wu
2018-10-26 11:51     ` Hans Holmberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANr-nt2bHSPhpRprvYcb1L-rhPFri0Cm2YBWdV+6AHe1Mk3mMw@mail.gmail.com \
    --to=hans.ml.holmberg@owltronix.com \
    --cc=hongd@marvell.com \
    --cc=javier@cnexlabs.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mb@lightnvm.io \
    --cc=zjwu@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).