Skip to content

Commit

Permalink
dm btree remove: fix bug in remove_one()
Browse files Browse the repository at this point in the history
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: 4ec331c ("dm btree: add dm_btree_remove_leaves()")
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Joe Thornber authored and Mike Snitzer committed Aug 7, 2015
1 parent bd4aaf8 commit aa0cd28
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/persistent-data/dm-btree-remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa0cd28

Please sign in to comment.