Message ID | 1283114768.2003.222.camel@brekeke |
---|---|
State | Accepted |
Commit | d3f6e6c666c0f68991d785177c4c62fcd1d651f2 |
Headers | show |
On Sun, 2010-08-29 at 23:46 +0300, Artem Bityutskiy wrote: > Because of inlining, your stack-dump lacks some function calls. I think > it was: ubifs_replay_journal() -> replay_log_leb() -> ubifs_scan() > -> ... Then we had -EBADMSG, and returned back to 'replay_log_leb()'. > Then we call 'ubifs_recover_log_leb()', which scans the LEB again. > > Yes, this is sub-optimal to scan twice, but this is how the thing is > implemented. I can try to fix it later - but this is not so important > now, let's first deal with your issues. But please, feel free to bug me > later and remind about this. An additional idea: we can strengthen 'ubi_io_read()' and make it re-try several times if there was -EBADMSG. It already retires for 'read != len' case, but probably we should make it retry in case of any error. But this is not a fix, just an improvement. Lets do this at the end, when we have addressed your issues, because otherwise it will be more difficult to reproduce. So, let's postpone this, but please, bug me and remind about this. > From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> > Subject: [PATCH] UBIFS: do not oops when erroneous PEB is scheduled for scrubbing And of course the prefix should be "UBI:". I've pushed this patch to the UBI tree as well.
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index ee7b1d8..97a4356 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -1212,7 +1212,8 @@ int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum) retry: spin_lock(&ubi->wl_lock); e = ubi->lookuptbl[pnum]; - if (e == ubi->move_from || in_wl_tree(e, &ubi->scrub)) { + if (e == ubi->move_from || in_wl_tree(e, &ubi->scrub) || + in_wl_tree(e, &ubi->erroneous)) { spin_unlock(&ubi->wl_lock); return 0; }