]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix kernel oops if the journal superblock has a non-zero j_errno
authorTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:30:13 +0000 (21:30 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 28 Oct 2010 01:30:13 +0000 (21:30 -0400)
commita516e7237f85a504c7eaa31b53ef361331e4c384
treee48cbf01bc646e63df2fea10a2208015e028b95b
parent8749c1e865a8b1563d41b7ab87d23c7bedcbeed9
ext4: fix kernel oops if the journal superblock has a non-zero j_errno

Commit 6b00fa1 fixed an accounting bug only to introduce the
possibility of a kernel OOPS if the journal has a non-zero j_errno
field indicating that the file system had detected a fs inconsistency.
After the journal replay, if the journal superblock indicates that the
file system has an error, this indication is transfered to the file
system and then ext4_commit_super() is called to write this to the
disk.

But since the percpu counters are now initialized after the journal
replay, the call to ext4_commit_super() will cause a kernel oops since
it needs to use the percpu counters the ext4 superblock structure.

The fix is to skip setting the ext4 free block and free inode fields
if the percpu counter has not been set.

Thanks to Ken Sumrall for reporting and analyzing the root causes of
this bug.

Addresses-Google-Bug: #3054080

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/super.c
include/linux/percpu_counter.h