lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 29 Aug 2018 16:51:13 +0200
From:   Hans Holmberg <hans.ml.holmberg@...tronix.com>
To:     Matias Bjorling <mb@...htnvm.io>
Cc:     linux-block@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Javier Gonzalez <javier@...xlabs.com>,
        Hans Holmberg <hans.holmberg@...xlabs.com>
Subject: Re: [PATCH 2/7] lightnvm: pblk: fix mapping issue on failed writes

On Wed, Aug 29, 2018 at 3:23 PM Matias Bjørling <mb@...htnvm.io> wrote:
>
> On 08/29/2018 02:23 PM, Hans Holmberg wrote:
> > From: Hans Holmberg <hans.holmberg@...xlabs.com>
> >
> > On 1.2-devices, the mapping-out of remaning sectors in the
> > failed-write's block can result in an infinite loop,
> > stalling the write pipeline, fix this.
> >
> > Fixes: 6a3abf5beef6 ("lightnvm: pblk: rework write error recovery path")
> >
> > Signed-off-by: Hans Holmberg <hans.holmberg@...xlabs.com>
> > ---
> >   drivers/lightnvm/pblk-write.c | 45 ++++++++++++++++++++++++++++++++++---------
> >   1 file changed, 36 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c
> > index 1bc879ab679d..fd67325f6e54 100644
> > --- a/drivers/lightnvm/pblk-write.c
> > +++ b/drivers/lightnvm/pblk-write.c
> > @@ -103,6 +103,41 @@ static void pblk_complete_write(struct pblk *pblk, struct nvm_rq *rqd,
> >       pblk_rb_sync_end(&pblk->rwb, &flags);
> >   }
> >
> > +static int pblk_next_ppa_in_blk(struct nvm_geo *geo, struct ppa_addr *ppa)
> > +{
> > +     int done = 0;
>
> Could this please be renamed to last to signify it is the last ppa in
> the ppa.

Yes, that would be better.

>
> > +
> > +     if (geo->version == NVM_OCSSD_SPEC_12) {
> > +             int sec = ppa->g.sec;
> > +
> > +             sec++;
> > +             if (sec == geo->ws_min) {
> > +                     int pg = ppa->g.pg;
> > +
> > +                     sec = 0;
> > +                     pg++;
> > +                     if (pg == geo->num_pg) {
> > +                             int pl = ppa->g.pl;
> > +
> > +                             pg = 0;
> > +                             pl++;
> > +                             if (pl == geo->num_pln)
> > +                                     done = 1;
> > +
> > +                             ppa->g.pl = pl;
> > +                     }
> > +                     ppa->g.pg = pg;
> > +             }
> > +             ppa->g.sec = sec;
> > +     } else {
> > +             ppa->m.sec++;
> > +             if (ppa->m.sec == geo->clba)
> > +                     done = 1;
> > +     }
> > +
> > +     return done;
> > +}
> > +
>
> Can you please move this function to core? I want to avoid introducing
> more if's around 1.2/2.0 in targets.

That makes sense, i'll post a V2. Thanks for the review.

>
> >   /* Map remaining sectors in chunk, starting from ppa */
> >   static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa)
> >   {
> > @@ -125,15 +160,7 @@ static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa)
> >               if (!test_and_set_bit(paddr, line->invalid_bitmap))
> >                       le32_add_cpu(line->vsc, -1);
> >
> > -             if (geo->version == NVM_OCSSD_SPEC_12) {
> > -                     map_ppa.ppa++;
> > -                     if (map_ppa.g.pg == geo->num_pg)
> > -                             done = 1;
> > -             } else {
> > -                     map_ppa.m.sec++;
> > -                     if (map_ppa.m.sec == geo->clba)
> > -                             done = 1;
> > -             }
> > +             done = pblk_next_ppa_in_blk(geo, &map_ppa);
> >       }
> >
> >       line->w_err_gc->has_write_err = 1;
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ