[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1205151349580.18866@eristoteles.iwoars.net>
Date: Tue, 15 May 2012 13:56:34 +0200 (CEST)
From: Joel Reardon <joel@...mbassador.com>
To: Artem Bityutskiy <dedekind1@...il.com>
cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: determining if a block erasure failed
Ah yes, if wl_wrk is freed in schedule_erase, theres no way to pass it
back that way.
The reason is that, if erasing a block of keys fails, then those keys may
remain on the flash device for eternity. While a rare occurance, it may be
nice to have ubifs perform GC on all main LEBs storing the data nodes that
can no longer be deleted through key erasure / reencrypt the valid data
nodes.
Cheers,
Joel Reardon
On Tue, 15 May 2012, Artem Bityutskiy wrote:
> On Tue, 2012-05-15 at 09:53 +0200, Joel Reardon wrote:
> > I want the caller of erase_worker() to be aware if the erase block became
> > bad. Here is the relevant code at the end of erase_worker():
> >
> > /* at this time, the erase has failed. err == -EIO */
> > ubi_msg("mark PEB %d as bad", pnum);
> > err = ubi_io_mark_bad(ubi, pnum);
> > if (err)
> > goto out_ro;
> >
> > /* does other stuff, not touching err */
> >
> > /* err == 0 here, because of above goto */
> > return err;
> >
> > out_ro:
> > ubi_ro_mode(ubi);
> > return err;
> >
> >
> > So, if this function should return zero when the erase block fails, then I
> > will add a "result" field to ubi_work that will store the result of the
> > work function. But I figured I'd check first if the return err that always
> > returns 0 is not an oversight and this function should return -EIO if it
> > fails.
>
> Why do you need the results?
>
> --
> Best Regards,
> Artem Bityutskiy
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists