]> git.karo-electronics.de Git - karo-tx-linux.git/commit
block: fix synchronization and limit check in blk_alloc_devt()
authorTejun Heo <tj@kernel.org>
Thu, 7 Feb 2013 01:31:34 +0000 (12:31 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 18 Feb 2013 05:47:28 +0000 (16:47 +1100)
commit318762f3b5d5965343d68dd8d178187be3106e67
tree2a6bf5dbc4bf5bc9951b66ec7d79e146c158bf71
parente5097a30061f611c5ec8939d06adad5340b5773d
block: fix synchronization and limit check in blk_alloc_devt()

idr allocation in blk_alloc_devt() wasn't synchronized against lookup
and removal, and its limit check was off by one - 1 << MINORBITS is
the number of minors allowed, not the maximum allowed minor.

Add locking and rename MAX_EXT_DEVT to NR_EXT_DEVT and fix limit
checking.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jens Axboe <axboe@kernel.dk>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
block/genhd.c