Whamcloud - gitweb
libext2fs: iterate past lower extents during punch
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 6 Feb 2014 20:29:15 +0000 (15:29 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Feb 2014 20:29:33 +0000 (15:29 -0500)
commit80dec4cb31957cde8850fa720532a32760bf3075
tree34518823ec537c6673af8294dd23546dde1f45ee
parent84593c2ac619da6ff514e5e0d217ba8762c8f2ce
libext2fs: iterate past lower extents during punch

When we're iterating extents during a punch operation, the loop exits
if the punch region is entirely to the right of the extent we're
looking at.  This can happen if the punch region starts in the middle
of a hole and covers mapped extents.  When this happens, we want to
skip to the next extent, because it might be punchable.

Also, if we've totally passed the punch range, stop.

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/punch.c