]> git.baikalelectronics.ru Git - 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)
committerMike Snitzer <snitzer@redhat.com>
Mon, 24 Apr 2017 18:47:49 +0000 (14:47 -0400)
commit54b21fa2eab71ec8c52dd7e5ec3f1d4ac2e58de0
tree05e10eb320014e8e5f98083343bd9135eb18ff28
parentfb6599e262c0863d875de8d1693eb1d16bdae648
dm btree: fix for dm_btree_find_lowest_key()

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.

Cc: stable@vger.kernel.org
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>
drivers/md/persistent-data/dm-btree.c