]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: ensure btrfs_prev_leaf doesn't miss 1 item
authorFilipe Manana <fdmanana@gmail.com>
Mon, 9 Jun 2014 12:22:13 +0000 (13:22 +0100)
committerChris Mason <clm@fb.com>
Tue, 10 Jun 2014 00:21:09 +0000 (17:21 -0700)
commitc9780d88e8787017b480b665a83c02d686ae525f
tree77e42e97eb36ecb958057a2d2c525565fa7e2f3c
parent89e521b3f2ef7645d6e57fdb2f8bf324df1e5d2d
Btrfs: ensure btrfs_prev_leaf doesn't miss 1 item

We might have had an item with the previous key in the tree right
before we released our path. And after we released our path, that
item might have been pushed to the first slot (0) of the leaf we
were holding due to a tree balance. Alternatively, an item with the
previous key can exist as the only element of a leaf (big fat item).
Therefore account for these 2 cases, so that our callers (like
btrfs_previous_item) don't miss an existing item with a key matching
the previous key we computed above.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ctree.c