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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Dec 2013 15:29:27 +0000 (07:29 -0800)
commit72b9401c2f5ac465d97969ef7933753642bde8bf
tree8cc1c1de6433edd93ca7bf744b84c4884e3a16e3
parent6d53d39270ccd29938dcbd611a44870c63032521
elevator: acquire q->sysfs_lock in elevator_change()

commit 7c8a3679e3d8e9d92d58f282161760a0e247df97 upstream.

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>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/elevator.c