]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix synchronization and limit check in blk_alloc_devt()
authorTejun Heo <tj@kernel.org>
Thu, 28 Feb 2013 01:03:56 +0000 (17:03 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Feb 2013 03:10:14 +0000 (19:10 -0800)
commitecc56a714028deea1ef57daac2c1880860048dce
tree5642d356f830bc3987f65f6879249cf96bf24df2
parentf54cec0fd301beb8c918beaedb881a3f17a5b10f
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
block/genhd.c