Btrfs: make sure not to return overlapping extents to fiemap
authorChris Mason <chris.mason@oracle.com>
Tue, 8 Mar 2011 16:54:40 +0000 (11:54 -0500)
committerChris Mason <chris.mason@oracle.com>
Tue, 8 Mar 2011 16:58:09 +0000 (11:58 -0500)
commitea8efc74bd0402b4d5f663d007b4e25fa29ea778
treead3f19c4281877767f6dce99f0e003284a159e71
parent31339acd07b4ba687906702085127895a56eb920
Btrfs: make sure not to return overlapping extents to fiemap

The btrfs fiemap code was incorrectly returning duplicate or overlapping
extents in some cases.  cp was blindly trusting this result and we would
end up with a destination file that was bigger than the original because
some bytes were copied twice.

The fix here adjusts our offsets to make sure we're always moving
forward in the fiemap results.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent_io.c