Files
android_kernel_xiaomi_sm8450/drivers/md
Joe Thornber 2871c69e02 dm btree remove: fix a bug when rebalancing nodes after removal
Commit 4c7e309340 ("dm btree remove: fix bug in redistribute3") wasn't
a complete fix for redistribute3().

The redistribute3 function takes 3 btree nodes and shares out the entries
evenly between them.  If the three nodes in total contained
(MAX_ENTRIES * 3) - 1 entries between them then this was erroneously getting
rebalanced as (MAX_ENTRIES - 1) on the left and right, and (MAX_ENTRIES + 1) in
the center.

Fix this issue by being more careful about calculating the target number
of entries for the left and right nodes.

Unit tested in userspace using this program:
https://github.com/jthornber/redistribute3-test/blob/master/redistribute3_t.c

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
2015-10-23 14:02:55 -04:00
..
2015-04-22 07:59:39 +10:00
2014-01-14 23:23:03 -05:00
2015-08-13 12:32:04 -06:00
2013-08-23 09:02:13 -04:00
2012-07-30 17:25:16 -07:00
2015-10-06 10:08:16 -04:00
2015-08-13 12:31:57 -06:00
2015-08-13 12:31:57 -06:00
2015-08-13 12:31:57 -06:00