linux/fs/ubifs
Richard Weinberger 1cb51a15b5 ubifs: Fix journal replay wrt. xattr nodes
When replaying the journal it can happen that a journal entry points to
a garbage collected node.
This is the case when a power-cut occurred between a garbage collect run
and a commit. In such a case nodes have to be read using the failable
read functions to detect whether the found node matches what we expect.

One corner case was forgotten, when the journal contains an entry to
remove an inode all xattrs have to be removed too. UBIFS models xattr
like directory entries, so the TNC code iterates over
all xattrs of the inode and removes them too. This code re-uses the
functions for walking directories and calls ubifs_tnc_next_ent().
ubifs_tnc_next_ent() expects to be used only after the journal and
aborts when a node does not match the expected result. This behavior can
render an UBIFS volume unmountable after a power-cut when xattrs are
used.

Fix this issue by using failable read functions in ubifs_tnc_next_ent()
too when replaying the journal.
Cc: stable@vger.kernel.org
Fixes: 1e51764a3c ("UBIFS: add new flash file system")
Reported-by: Rock Lee <rockdotlee@gmail.com>
Reviewed-by: David Gstir <david@sigma-star.at>
Signed-off-by: Richard Weinberger <richard@nod.at>
2017-01-17 14:35:58 +01:00
..
budget.c
commit.c
compress.c
crypto.c
debug.c
debug.h
dir.c ubifs: remove redundant checks for encryption key 2017-01-17 14:34:21 +01:00
file.c
find.c
gc.c
io.c
ioctl.c ubifs: allow encryption ioctls in compat mode 2017-01-17 14:33:41 +01:00
journal.c ubifs: fix unencrypted journal write 2017-01-17 14:05:23 +01:00
Kconfig ubifs: add CONFIG_BLOCK dependency for encryption 2017-01-17 14:32:47 +01:00
key.h
log.c
lprops.c
lpt_commit.c
lpt.c
Makefile
master.c
misc.c
misc.h
orphan.c
recovery.c
replay.c
sb.c
scan.c
shrinker.c
super.c
tnc_commit.c
tnc_misc.c
tnc.c ubifs: Fix journal replay wrt. xattr nodes 2017-01-17 14:35:58 +01:00
ubifs-media.h
ubifs.h
xattr.c