]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsck: check and fix tails of all bitmap blocks
authorTheodore Ts'o <tytso@mit.edu>
Sun, 5 May 2019 20:43:33 +0000 (16:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 6 May 2019 14:15:29 +0000 (10:15 -0400)
commitd0efd17a436aacda85aae86bb6dfed4226a9e0a9
treef1f7cc33613501f95133aea64792cf099f8c24fd
parent4a274baf2a6fcd0d73865f4b60529ff4dfa569bd
e2fsck: check and fix tails of all bitmap blocks

Currently, e2fsck effectively checks only tail of the last inode and
block bitmap in the filesystem. Thus if some previous bitmap has unset
bits it goes unnoticed.  Mostly these tail bits in the bitmap are
ignored; however, if blocks_per_group are smaller than 8*blocksize,
the multi-block allocator in the kernel can get confused when the tail
bits are unset and return bogus free extent.

Add support to libext2fs to check these bitmap tails when loading
bitmaps (as that's about the only place which has access to the bitmap
tail bits) and make e2fsck use this functionality to detect buggy bitmap
tails and fix them (by rewriting the bitmaps).

Reported-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
29 files changed:
e2fsck/pass5.c
lib/ext2fs/ext2fs.h
lib/ext2fs/rw_bitmaps.c
tests/f_bitmaps/expect.1
tests/f_dup/expect.1
tests/f_dup2/expect.1
tests/f_dup3/expect.1
tests/f_end-bitmap/expect.1
tests/f_illbbitmap/expect.1
tests/f_illibitmap/expect.1
tests/f_illitable_flexbg/expect.1
tests/f_lpf/expect.1
tests/f_overfsblks/expect.1
tests/f_super_bad_csum/expect.1
tests/j_corrupt_ext_jnl_sb_csum/expect
tests/j_ext_long_trans/expect
tests/j_long_trans/expect
tests/j_long_trans_mcsum_32bit/expect
tests/j_long_trans_mcsum_64bit/expect
tests/j_recover_csum2_32bit/expect.1
tests/j_recover_csum2_64bit/expect.1
tests/j_short_trans/expect
tests/j_short_trans_64bit/expect
tests/j_short_trans_mcsum_64bit/expect
tests/j_short_trans_old_csum/expect
tests/j_short_trans_open_recover/expect
tests/j_short_trans_recover/expect
tests/j_short_trans_recover_mcsum_64bit/expect
tests/t_replay_and_set/expect