dm btree remove: fix bug in remove_one()
authorJoe Thornber <ejt@redhat.com>
Fri, 7 Aug 2015 15:33:01 +0000 (16:33 +0100)
committerMike Snitzer <snitzer@redhat.com>
Fri, 7 Aug 2015 15:56:43 +0000 (11:56 -0400)
remove_one() was not incrementing the key for the beginning of the
range, so not all entries were being removed.  This resulted in
discards that were not unmapping all blocks.

Fixes: 4ec331c3ea ("dm btree: add dm_btree_remove_leaves()")
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/persistent-data/dm-btree-remove.c

index 9836c0ae897c33c4e227bca77cc95026c193f73c..9ca9eccd512fd99f8116a20ab1b3ed67d821cb6d 100644 (file)
@@ -689,6 +689,7 @@ static int remove_one(struct dm_btree_info *info, dm_block_t root,
                                             value_ptr(n, index));
 
                delete_at(n, index);
+               keys[last_level] = k + 1ull;
 
        } else
                r = -ENODATA;