elevator: acquire q->sysfs_lock in elevator_change()
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>
Tue, 15 Oct 2013 22:42:19 +0000 (16:42 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Oct 2013 22:42:19 +0000 (16:42 -0600)
commite209e83269454769cdde0da2ac46c7ab47399507
tree1fceb5e07fc0c806d60b88dc573c26d7611a64d0
parent27e4d3d0f3eb032ed59468ed3f3d773cdb5eb57b
elevator: acquire q->sysfs_lock in elevator_change()

Add locking of q->sysfs_lock into elevator_change() (an exported function)
to ensure it is held to protect q->elevator from elevator_init(), even if
elevator_change() is called from non-sysfs paths.
sysfs path (elv_iosched_store) uses __elevator_change(), non-locking
version, as the lock is already taken by elv_iosched_store().

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/elevator.c