]> git.kernelconcepts.de Git - karo-tx-linux.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)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Mar 2013 03:24:16 +0000 (03:24 +0000)
commita51db52c68e3ad5c718c1915d28086b2c0ef8642
tree3380212a171f9af3855eb93239f9e39f75601aa6
parent18536d611e05f6141504c7029943967ea3b56ba7
block: fix synchronization and limit check in blk_alloc_devt()

commit ce23bba842aee98092225d9576dba47c82352521 upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
block/genhd.c