ext4: verify ext4 when the starting block of index and leaf are inconsistent
Insert the extent entry in ext4_ext_insert_extent() (to be inserted at
the beginning of the block). In the stage of updating the starting block
number of the parent index block, an error happened
in ext4_ext_correct_indexes()->ext4_ext_get_access(), which caused the
index update of the parent index node to fail. The ext4_ext_insert_extent()
function exits directly and does not roll back the extent entry of
the leaf block. Eventually, the extent starting block numbers in
the index block and leaf block are inconsistent, triggering bugon.
This is a regression test for three kernel commit:
1.
0f2f87d51aebc (ext4: prevent partial update of the extent blocks)
2.
9c6e071913792 (ext4: check for inconsistent extents between index
and leaf block)
3.
8dd27fecede55 (ext4: check for out-of-order index extents in
ext4_valid_extent_entries())
Signed-off-by: Chen Long <chenlongcl.chen@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>