[U-Boot] [U-Boot, v2] fs: btrfs: Fix wrong comparison in logical to physical mapping

Tom Rini trini at konsulko.com
Fri Jul 20 22:34:35 UTC 2018


On Wed, Jul 04, 2018 at 08:23:01PM +0200, Marek BehĂșn wrote:

> The comparison
>   logical > item->logical + item->length
> in btrfs_map_logical_to_physical is wrong and should be instead
>   logical >= item->logical + item->length
> For example, if
>   item->logical = 4096
>   item->length = 4096
> and we are looking for logical = 8192, it is not part of item (item is
> [4096, 8191]). But the comparison is false and we think we have found
> the correct item, although we should be searing in the right subtree.
> 
> This fixes some bugs I encountered.
> 
> Signed-off-by: Marek Behun <marek.behun at nic.cz>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180720/9fe43b4c/attachment.sig>


More information about the U-Boot mailing list