u-boot-brain/fs/btrfs
Pierre Bourdon 1627e5e598 fs: btrfs: fix btrfs_search_tree invalid results
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>
2019-04-26 17:53:16 -04:00
..
btrfs_tree.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
btrfs.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
btrfs.h fs: btrfs: Do not fail when all root_backups are empty 2018-06-18 14:43:12 -04:00
chunk-map.c fs: btrfs: Fix wrong comparison in logical to physical mapping 2018-07-20 15:37:44 -04:00
compression.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
conv-funcs.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ctree.c fs: btrfs: fix btrfs_search_tree invalid results 2019-04-26 17:53:16 -04:00
ctree.h fs: btrfs: fix false negatives in ROOT_ITEM search 2019-04-26 17:53:15 -04:00
dev.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dir-item.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
extent-io.c fs: btrfs: Fix cache alignment bugs 2018-09-30 13:00:37 -04:00
hash.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
inode.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Kconfig fs: btrfs: Add U-Boot fs handlers. 2017-10-02 21:52:18 -04:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
root.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
subvolume.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
super.c fs: btrfs: Fix cache alignment bugs 2018-09-30 13:00:37 -04:00