For file extents xfs currently always calls xfs_bmapi_read with not flags, meaning extents are going to be truncated to the requested range. This is differs than what other filesystems do (ext4/btrfs don't trim extents). So harmonize the behavior across the filesystem by explicitly not trimming extents when we are called from fiemap code. Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx> --- fs/xfs/xfs_iomap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c index f179bdf1644d..129550fbf898 100644 --- a/fs/xfs/xfs_iomap.c +++ b/fs/xfs/xfs_iomap.c @@ -1008,7 +1008,8 @@ xfs_file_iomap_begin( end_fsb = XFS_B_TO_FSB(mp, offset + length); error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap, - &nimaps, 0); + &nimaps, + flags & IOMAP_REPORT ? XFS_BMAPI_ENTIRE : 0); if (error) goto out_unlock; -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html