e2fsprogs/lib
Darrick J. Wong acbca26e25 libext2fs: fix parents when modifying extents
In ext2fs_extent_set_bmap() and ext2fs_punch_extent(), fix the parents
when altering either end of an extent so that the parent nodes reflect
the added mapping.

There's a slight complication to using fix_parents: if there are two
mappings to an lblk in the tree, the value of handle->path->curr can
point to either extent afterwards), which is documented in a comment.

Some additional color commentary from Darrick:

  In the _set_bmap() case, I noticed that the "remapping last block in
  extent" case would produce symptoms if we are trying to remap a
  block from "extent" to "next_extent", and the two extents are
  pointed to by different index nodes.  _extent_replace(...,
  next_extent) updates e_lblk in the leaf extent, but because there's
  no _extent_fix_parents() call, the index nodes never get updated.

  In the _punch_extent() case, we conclude that we need to split an
  extent into two pieces since we're punching out the middle.  If the
  extent is the last extent in the block, the second extent will be
  inserted into a new leaf node block.  Without _fix_parents(), the
  index node doesn't seem to get updated.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-03-15 11:36:36 -04:00
..
blkid all: Introduce cppcheck static checking for make C=1 2014-03-14 09:32:50 -04:00
e2p all: Introduce cppcheck static checking for make C=1 2014-03-14 09:32:50 -04:00
et all: Introduce cppcheck static checking for make C=1 2014-03-14 09:32:50 -04:00
ext2fs libext2fs: fix parents when modifying extents 2014-03-15 11:36:36 -04:00
quota all: Introduce cppcheck static checking for make C=1 2014-03-14 09:32:50 -04:00
ss all: Introduce cppcheck static checking for make C=1 2014-03-14 09:32:50 -04:00
uuid all: Introduce cppcheck static checking for make C=1 2014-03-14 09:32:50 -04:00
Makefile.bsd-lib Include LDFLAGS when building BSD libraries 2012-05-11 22:21:08 -04:00
Makefile.checker Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.darwin-lib Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.elf-lib Put ELF_OTHER_LIBS in the right place for the linker 2012-08-06 12:30:49 -04:00
Makefile.library Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.profile Add configure options --enable-symlink-build and --enable-symlink-install 2010-05-17 19:21:42 -04:00
Makefile.solaris-lib Put ELF_OTHER_LIBS in the right place for the linker 2012-08-06 12:30:49 -04:00
config.h.in Merge branch 'maint' into next 2014-01-30 19:05:16 -05:00
dirpaths.h.in Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
fpopen.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00