remarkable-linux/fs/ubifs
Artem Bityutskiy 91c66083fc UBIFS: expect corruption only in last journal head LEBs
This patch improves UBIFS recovery and teaches it to expect corruption only
in the last buds. Indeed, currently we just recover all buds, which is
incorrect because only the last buds can have corruptions in case of a power
cut. So it is inconsistent with the rest of the recovery strategy which tries
hard to distinguish between corruptions cause by power cuts and other types of
corruptions.

This patch also adds one quirk - a bit older UBIFS was could have corruption in
the next to last bud because of the way it switched buds: when bud A is full,
it first searched for the next bud B, the wrote a reference node to the log
about B, and then synchronized the write-buffer of A. So we could end up with
buds A and B, where B is the last, but A had corruption. The UBIFS behavior
was fixed, though, so currently it always first synchronizes A's write-buffer
and only after this adds B to the log. However, to be make sure that we handle
unclean (after a power cut) UBIFS images belonging to older UBIFS - we need to
add a quirk and keep it for some time: we need to check for the situation
described above.

Thankfully, it is easy to check for that situation. When UBIFS adds B to the
log, it always first unmaps B, then maps it, and then syncs A's write-buffer.
Thus, in that situation we can check that B is empty, in which case it is OK to
have corruption in A. To check that B is empty it is enough to just read the
first few bytes of the bud and compare them with 0xFFs. This quirk may be
removed in a couple of years.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2011-05-16 14:11:25 +03:00
..
budget.c UBIFS: introduce a separate structure for budgeting info 2011-05-13 19:23:53 +03:00
commit.c UBIFS: introduce a separate structure for budgeting info 2011-05-13 19:23:53 +03:00
compress.c UBIFS: fix sparse warnings 2008-12-31 14:13:24 +02:00
debug.c UBIFS: fix debugging FS checking failure 2011-05-13 19:23:57 +03:00
debug.h UBIFS: dump the stack on errors in failure mode too 2011-05-13 19:23:56 +03:00
dir.c UBIFS: introduce a separate structure for budgeting info 2011-05-13 19:23:53 +03:00
file.c UBIFS: remove strange commentary 2011-05-13 19:23:55 +03:00
find.c UBIFS: introduce a separate structure for budgeting info 2011-05-13 19:23:53 +03:00
gc.c UBIFS: synchronize write-buffer before switching to the next bud 2011-05-16 10:31:41 +03:00
io.c UBIFS: synchronize write-buffer before switching to the next bud 2011-05-16 10:31:41 +03:00
ioctl.c userns: rename is_owner_or_cap to inode_owner_or_capable 2011-03-23 19:47:13 -07:00
journal.c UBIFS: synchronize write-buffer before switching to the next bud 2011-05-16 10:31:41 +03:00
Kconfig UBIFS: do not select KALLSYMS_ALL 2011-04-05 10:45:45 +03:00
key.h UBIFS: mark unused key objects as invalid 2010-08-30 10:19:08 +03:00
log.c UBIFS: do not free write-buffers when in R/O mode 2011-05-02 19:23:36 +03:00
lprops.c UBIFS: dump more in the lprops debugging check 2011-05-16 10:31:39 +03:00
lpt.c UBIFS: fix oops on error path in read_pnode 2011-04-05 10:40:31 +03:00
lpt_commit.c UBIFS: introduce lsave debugging 2011-05-13 19:23:54 +03:00
Makefile UBIFS: include to compilation 2008-07-15 17:35:24 +03:00
master.c UBIFS: introduce a separate structure for budgeting info 2011-05-13 19:23:53 +03:00
misc.h UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
orphan.c UBIFS: fix minor stylistic issues 2011-05-13 19:23:53 +03:00
recovery.c UBIFS: improve debugging messages 2011-05-16 10:31:39 +03:00
replay.c UBIFS: expect corruption only in last journal head LEBs 2011-05-16 14:11:25 +03:00
sb.c UBIFS: fix a rare memory leak in ro to rw remounting path 2011-05-13 19:23:57 +03:00
scan.c UBIFS: remove double semicolon 2011-02-06 15:08:02 +02:00
shrinker.c UBIFS: introduce new flags for RO mounts 2010-09-19 21:07:58 +03:00
super.c UBIFS: fix a rare memory leak in ro to rw remounting path 2011-05-13 19:23:57 +03:00
tnc.c UBIFS: fix minor stylistic issues 2011-05-13 19:23:53 +03:00
tnc_commit.c UBIFS: make force in-the-gaps to be a general self-check 2011-05-13 19:23:54 +03:00
tnc_misc.c UBIFS: correct key comparison 2008-09-30 11:12:57 +03:00
ubifs-media.h UBIFS: use __packed instead of __attribute__((packed)) 2011-05-13 19:23:53 +03:00
ubifs.h UBIFS: substitute the replay tree with a replay list 2011-05-16 10:31:40 +03:00
xattr.c UBIFS: make xattr operations names consistent 2011-05-13 19:23:54 +03:00