__generic_block_fiemap() looks up extents within isize, so original function truncate len to isize if len >= isize, but when start > 0, start + len would still be greater than isize. Update len properly in this patch. Signed-off-by: Fan Li <fanofcode.li@xxxxxxxxxxx> --- fs/ioctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 41c352e..13a3e96 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -268,9 +268,12 @@ int __generic_block_fiemap(struct inode *inode, * since we expect isize to not change at all through the duration of * this call. */ - if (len >= isize) { + if (start >= isize) + return 0; + + if (start + len > isize) { whole_file = true; - len = isize; + len = isize - start; } /* -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html