]> git.ipfire.org Git - people/arne_f/kernel.git/commit
dm btree: fix for dm_btree_find_lowest_key()
authorVinothkumar Raja <vinraja@cs.stonybrook.edu>
Fri, 7 Apr 2017 02:09:38 +0000 (22:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 12:30:07 +0000 (14:30 +0200)
commitfa499b361bd4771fed7b94c367edf102e3c078a6
tree2f2e28a8af4ab93980248dc79f5915f88f5243ed
parentc04397351fe577a4b4d046524118c38d87002e81
dm btree: fix for dm_btree_find_lowest_key()

commit 7d1fedb6e96a960aa91e4ff70714c3fb09195a5a upstream.

dm_btree_find_lowest_key() is giving incorrect results.  find_key()
traverses the btree correctly for finding the highest key, but there is
an error in the way it traverses the btree for retrieving the lowest
key.  dm_btree_find_lowest_key() fetches the first key of the rightmost
block of the btree instead of fetching the first key from the leftmost
block.

Fix this by conditionally passing the correct parameter to value64()
based on the @find_highest flag.

Signed-off-by: Erez Zadok <ezk@fsl.cs.sunysb.edu>
Signed-off-by: Vinothkumar Raja <vinraja@cs.stonybrook.edu>
Signed-off-by: Nidhi Panpalia <npanpalia@cs.stonybrook.edu>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/persistent-data/dm-btree.c