diff options
| author | Tahsin Erdogan <[email protected]> | 2017-02-14 19:27:38 -0800 | 
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2017-02-15 08:40:04 -0700 | 
| commit | b410aff2bd9f101bc096069612391aecce204cd1 (patch) | |
| tree | 977805735b8ce122d67da721e8a960c15ef89769 /drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | |
| parent | 3d492c2e0146ccaad08c7cbe16e2e229328b5e79 (diff) | |
block: do not allow updates through sysfs until registration completes
When a new disk shows up, sysfs queue directory is created before elevator
is registered. This allows a user to attempt a scheduler switch even though
the initial registration hasn't completed yet.
In one scenario, blk_register_queue() calls elv_register_queue() and
right before cfq_registered_queue() is called, another process executes
elevator_switch() and replaces q->elevator with deadline scheduler. When
cfq_registered_queue() executes it interprets e->elevator_data as struct
cfq_data even though it is actually struct deadline_data.
Grab q->sysfs_lock in blk_register_queue() to synchronize with sysfs
callers.
Signed-off-by: Tahsin Erdogan <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c')
0 files changed, 0 insertions, 0 deletions