diff options
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/elevator.c b/block/elevator.c index 2bcbd8cc14d4..249cc5e10906 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -186,6 +186,12 @@ int elevator_init(struct request_queue *q, char *name) struct elevator_type *e = NULL; int err; + /* + * q->sysfs_lock must be held to provide mutual exclusion between + * elevator_switch() and here. + */ + lockdep_assert_held(&q->sysfs_lock); + if (unlikely(q->elevator)) return 0; |