]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix extent merging in ext4_ext_shift_path_extents()
authorLukas Czerner <lczerner@redhat.com>
Fri, 18 Apr 2014 14:55:24 +0000 (10:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 18 Apr 2014 14:55:24 +0000 (10:55 -0400)
commitbb1eb7dffc3e8f6ba31f697fd5eba557c8c6557e
treea73e48e51bff230566810c72ea665768dd62d7ea
parentbb7bad66d39ba48ca3c7666c0426142727092773
ext4: fix extent merging in ext4_ext_shift_path_extents()

There is a bug in ext4_ext_shift_path_extents() where if we actually
manage to merge a extent we would skip shifting the next extent. This
will result in in one extent in the extent tree not being properly
shifted.

This is causing failure in various xfstests tests using fsx or fsstress
with collapse range support. It will also cause file system corruption
which looks something like:

 e2fsck 1.42.9 (4-Feb-2014)
 Pass 1: Checking inodes, blocks, and sizes
 Inode 20 has out of order extents
        (invalid logical block 3, physical block 492938, len 2)
 Clear? yes
 ...

when running e2fsck.

It's also very easily reproducible just by running fsx without any
parameters. I can usually hit the problem within a minute.

Fix it by increasing ex_start only if we're not merging the extent.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
fs/ext4/extents.c