Whamcloud - gitweb
libext2fs: try to roll back when splitting an extent fails
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 6 Feb 2014 20:34:00 +0000 (15:34 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Feb 2014 20:34:00 +0000 (15:34 -0500)
commit156a151f3177a826f8ad7c360440abf6656f5aae
tree5fdf29365148efe78b764e3156e95963210b80d1
parent6225a154d2616edcd13885797ed5e1c0cc51e0b7
libext2fs: try to roll back when splitting an extent fails

If a client asks us to remap a block in the middle of an extent, we
potentially have to allocate a fair number of blocks to handle extent
tree splits.  A failure in either of the ext2fs_extent_insert calls
leaves us with an extent tree that no longer maps the logical block in
question and everything that came after it!  Therefore, try to roll
back the extent tree changes before returning an error code.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/extent.c