]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commita8f6db87b85150526087c91ee3c43e247f2f5e86
treeffe440a82656dc8d50b4234d497e8db7a31d47e0
parent07fe947b4111ca2ac850dc96061e1b80768c14bc
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