tmp_suning_uos_patched/fs/ubifs
Artem Bityutskiy 52c6e6f990 UBIFS: seek journal heads to the latest bud in replay
This is the second fix of the following symptom:

UBIFS error (pid 34456): could not find an empty LEB

which sometimes happens after power cuts when we mount the file-system - UBIFS
refuses it with the above error message which comes from the
'ubifs_rcvry_gc_commit()' function. I can reproduce this using the integck test
with the UBIFS power cut emulation enabled.

Analysis of the problem.

Currently UBIFS replay seeks the journal heads to the last _replayed_ bud.
But the buds are replayed out-of-order, so the replay basically seeks journal
heads to the "random" bud belonging to this head, and not to the _last_ one.

The result of this is that the GC head may be seeked to a full LEB with no free
space, or very little free space. And 'ubifs_rcvry_gc_commit()' tries to find a
fully or mostly dirty LEB to match the current GC head (because we need to
garbage-collect that dirty LEB at one go, because we do not have @c->gc_lnum).
So 'ubifs_find_dirty_leb()' fails and we fall back to finding an empty LEB and
also fail. As a result - recovery fails and mounting fails.

This patch teaches the replay to initialize the GC heads exactly to the latest
buds, i.e. the buds which have the largest sequence number in corresponding
log reference nodes.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: stable@kernel.org
2011-05-02 19:23:48 +03:00
..
budget.c
commit.c UBIFS: do not read flash unnecessarily 2011-04-05 10:39:40 +03:00
compress.c
debug.c UBIFS: fix debugging failure in dbg_check_space_info 2011-04-05 11:07:37 +03:00
debug.h UBIFS: fix compilation warnings when compiling with gcc 4.5 2011-04-13 11:59:09 +03:00
dir.c
file.c UBIFS: fix oops when R/O file-system is fsync'ed 2011-04-13 10:43:32 +03:00
find.c
gc.c
io.c
ioctl.c
journal.c
Kconfig UBIFS: do not select KALLSYMS_ALL 2011-04-05 10:45:45 +03:00
key.h
log.c UBIFS: do not free write-buffers when in R/O mode 2011-05-02 19:23:36 +03:00
lprops.c
lpt_commit.c
lpt.c UBIFS: fix oops on error path in read_pnode 2011-04-05 10:40:31 +03:00
Makefile
master.c
misc.h
orphan.c
recovery.c UBIFS: fix master node recovery 2011-04-21 15:27:21 +03:00
replay.c UBIFS: seek journal heads to the latest bud in replay 2011-05-02 19:23:48 +03:00
sb.c
scan.c
shrinker.c
super.c UBIFS: do not free write-buffers when in R/O mode 2011-05-02 19:23:36 +03:00
tnc_commit.c
tnc_misc.c
tnc.c
ubifs-media.h
ubifs.h
xattr.c fs: export empty_aops 2011-04-05 23:51:48 +02:00