Whamcloud - gitweb
e2fsck: update j_tail_sequence after recovery
authorDaeho Jeong <daeho.jeong@samsung.com>
Wed, 6 Jul 2016 00:10:39 +0000 (09:10 +0900)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 6 Jul 2016 03:10:21 +0000 (23:10 -0400)
commit32448f50df7d974ded956bbc78a419cf65ec09a3
tree6bb3a19c7146571c2ad9eff25ad10d5d93377f80
parent49aa3ff1f17c3a042b8d9d8a004e5b552ba2d0b1
e2fsck: update j_tail_sequence after recovery

When journal is released, s_sequence is set to j_tail_sequence.
But, currently, even if the recovery process is successfully completed,
the j_tail_sequence and, finally, s_sequence are never changed. By this,
when we repeat doing power-off the device suddenly and executing e2fsck
without full scan before mount, the s_sequence number will never change
and, in a very rare case, newly generated journal logs will be
surprisingly grafted to the old journal logs. In this case, out-of-date
metadata log can be replayed on the filesystem area and the filesystem
can be crashed unintentionally by journal recovery process. Therefore,
we need to update j_tail_sequence after recovery process is successfully
completed in e2fsck.

Youngjin had repeated this test and found the problem. With our test,
the filesystem crash occurred within 4 hours.

Signed-off-by: Youngjin Gil <youngjin.gil@samsung.com>
Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/journal.c