]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit - lib/ext2fs/punch.c
libext2fs: fix punching extents when there are no left extents
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 12 Dec 2013 18:23:51 +0000 (13:23 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 12 Dec 2013 18:23:54 +0000 (13:23 -0500)
commitdc9673abcf8e00f2b2e6e346b6312ef3745ac543
tree37eea9d4afc14f8fcb9d39fa449ccc1daebdb086
parent8a86bbb19714c135aef07095d0b3c1d7e4f7a155
libext2fs: fix punching extents when there are no left extents

When deleting an entire extent, we cannot always slip to the previous
leaf extent because there might not /be/ a previous extent.
Attempting to correct for that error by asking for the 'current' leaf
extent also doesn't work, because the failed attempt to change to the
previous extent leaves us with no current extent.

Fix this problem by recording the lblk of the next extent before
deleting the current extent and _goto()ing to the next extent after
the deletion.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/punch.c