axmap: fix deadlock
authorMing Lei <ming.lei@canonical.com>
Sat, 3 Jan 2015 14:21:09 +0000 (22:21 +0800)
committerJens Axboe <axboe@fb.com>
Sat, 3 Jan 2015 18:11:08 +0000 (11:11 -0700)
commitd555a23db84364ab942361a719a4379605bdbc41
tree97689c11d69726e294b24cce9403f5b1275dc8db
parentaad918e47d119eb2043311f1a2a45ce109c047d1
axmap: fix deadlock

axmap_first_free() is always called with axmap->lock held,
so needn't to acquire the lock inside the function.

The deadlock is introduced in commit 12bde3697fc230d7a(axmap:
ensure we lock down the maps for shared access).

Given axmap_first_free() is only called inside lib/axmap.c,
this patch declares the function as static. In the future,
if external users need the function, axmap lock can be
considered at that time.

Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
lib/axmap.c
lib/axmap.h