Btrfs: fix btrfs_prev_leaf() previous key computation
authorFilipe David Borba Manana <fdmanana@gmail.com>
Mon, 14 Oct 2013 23:12:27 +0000 (00:12 +0100)
committerChris Mason <chris.mason@fusionio.com>
Tue, 12 Nov 2013 03:02:26 +0000 (22:02 -0500)
commite8b0d724d596f2ac1264ad830a04ef8e415be956
treeffe440a82656dc8d50b4234d497e8db7a31d47e0
parente93ae26fe1123e9077e79cc7af8a0d42adf4812f
Btrfs: fix btrfs_prev_leaf() previous key computation

If we decrement the key type, we must reset its offset to the largest
possible offset (u64)-1. If we decrement the key's objectid, then we
must reset the key's type and offset to their largest possible values,
(u8)-1 and (u64)-1 respectively. Not doing so can make us miss an
items in the tree.

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ctree.c