Re: [PATCH] btrfs: Return right extent when fiemap gives unaligned offset and len.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 18, 2014 at 09:55:43AM +0800, Qu Wenruo wrote:
> 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.

ALIGN rounds up, not down. So the wrong rounding will use incorrect start
(4096) and finds no extents if there's eg. only one [0,4095].

> This patch will round down start and round up (start + len) to
> return right extent.
> 
> Reported-by: Chandan Rajendra <chandan@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>

Reviewed-by: David Sterba <dsterba@xxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux