[PATCH 1/9 V2] idr: fix overflow bug during maximum ID calculation at maximum height

2014-04-19 Thread Lai Jiangshan
idr_replace() open-codes the logic to calculate the maximum valid ID given the height of the idr tree; unfortunately, the open-coded logic doesn't account for the fact that the top layer may have unused slots and over-shifts the limit to zero when the tree is at its maximum height. The following

[PATCH 1/9 V2] idr: fix overflow bug during maximum ID calculation at maximum height

2014-04-19 Thread Lai Jiangshan
idr_replace() open-codes the logic to calculate the maximum valid ID given the height of the idr tree; unfortunately, the open-coded logic doesn't account for the fact that the top layer may have unused slots and over-shifts the limit to zero when the tree is at its maximum height. The following