]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Return right extent when fiemap gives unaligned offset and len.
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 18 Jul 2014 01:55:43 +0000 (09:55 +0800)
committerChris Mason <clm@fb.com>
Tue, 19 Aug 2014 15:52:14 +0000 (08:52 -0700)
commit2c0040e50020e055dc98b67e4054026ceef09850
tree612ffb1243b1a0a01caa40766b70af8adb34e378
parent96dbea16ea6d559350f0e7d7ff14695283b98c4c
btrfs: Return right extent when fiemap gives unaligned offset and len.

When page aligned start and len passed to extent_fiemap(), the result is
good, but when start and len is not aligned, e.g. start = 1 and len =
4095 is passed to extent_fiemap(), it returns no extent.

The problem is that start and len is all rounded down which causes the
problem. This patch will round down start and round up (start + len) to
return right extent.

Reported-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent_io.c