From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, v2] fs: btrfs: fix btrfs_search_tree invalid results
Date: Sat, 27 Apr 2019 10:46:34 -0400 [thread overview]
Message-ID: <20190427144634.GO31207@bill-the-cat> (raw)
In-Reply-To: <20190416004714.27299-1-delroth@gmail.com>
On Tue, Apr 16, 2019 at 02:47:14AM +0200, Pierre Bourdon wrote:
> btrfs_search_tree should return the first item in the tree that is
> greater or equal to the searched item.
>
> The search algorithm did not properly handle the edge case where the
> searched item is higher than the last item of the node but lower than
> the first item of the next node. Instead of properly returning the first
> item of the next node, it was returning an invalid path pointer
> (pointing to a non-existent item after the last item of the node + 1).
>
> This fixes two issues in the btrfs driver:
> - Looking for a ROOT_ITEM could fail if it was the first item of its
> leaf node.
> - Iterating through DIR_INDEX entries (for readdir) could fail if the
> first DIR_INDEX entry was the first item of a leaf node.
>
> Signed-off-by: Pierre Bourdon <delroth@gmail.com>
> Cc: Marek Behun <marek.behun@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/20190427/96ff5a34/attachment.sig>
prev parent reply other threads:[~2019-04-27 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-16 0:47 [U-Boot] [PATCH v2] fs: btrfs: fix btrfs_search_tree invalid results Pierre Bourdon
2019-04-27 14:46 ` Tom Rini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190427144634.GO31207@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox