Whamcloud - gitweb
libext2fs: reset handle after inserting new extent
authorEric Sandeen <sandeen@redhat.com>
Tue, 7 Jul 2009 19:30:32 +0000 (14:30 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 8 Jul 2009 03:24:09 +0000 (23:24 -0400)
commit4bd87f22906188b6dba36d4b9ba5fc7acd337699
tree27795a1081b9b6a8b574ab1a8ac1fdbdf22d976f
parente31b32721df24a0794de4f8925112e21dc4699b4
libext2fs: reset handle after inserting new extent

Commit 53422e moved the new extent insertion in
ext2fs_extent_set_bmap() prior to the modification of the original
extent, but the insert function left the handle pointing to the new
extent.  This left us modifying the -new- extent, instead of the
original one, and winding up with a corrupt extent tree something
like:

BLOCKS:
(0-1):588791-588792, (0):588791

We need to move back to the previous extent prior
to modification, if we inserted a new one.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/extent.c