* determining if a block erasure failed
@ 2012-05-15 7:53 Joel Reardon
2012-05-15 11:40 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Joel Reardon @ 2012-05-15 7:53 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: linux-mtd, linux-kernel
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.
cheers,
Joel Reardon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: determining if a block erasure failed
2012-05-15 7:53 determining if a block erasure failed Joel Reardon
@ 2012-05-15 11:40 ` Artem Bityutskiy
2012-05-15 11:56 ` Joel Reardon
0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-15 11:40 UTC (permalink / raw)
To: Joel Reardon; +Cc: linux-mtd, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: determining if a block erasure failed
2012-05-15 11:40 ` Artem Bityutskiy
@ 2012-05-15 11:56 ` Joel Reardon
2012-05-15 12:22 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Joel Reardon @ 2012-05-15 11:56 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: linux-mtd, linux-kernel
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: determining if a block erasure failed
2012-05-15 11:56 ` Joel Reardon
@ 2012-05-15 12:22 ` Artem Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2012-05-15 12:22 UTC (permalink / raw)
To: Joel Reardon; +Cc: linux-mtd, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 616 bytes --]
On Tue, 2012-05-15 at 13:56 +0200, Joel Reardon wrote:
> 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.
Erasure is asynchronous and I do not see an good way to implement your
idea. Do you have a good plan?
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-15 12:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15 7:53 determining if a block erasure failed Joel Reardon
2012-05-15 11:40 ` Artem Bityutskiy
2012-05-15 11:56 ` Joel Reardon
2012-05-15 12:22 ` Artem Bityutskiy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.