mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Revert "block: fix race between switching elevator and removing queues"
This reverts commit 6c63a7be2b.
It breaks the abi and is not needed in Android devices.
Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic797c4aef587cf8b8ed62b91e60cb5b236af8036
This commit is contained in:
@@ -977,6 +977,7 @@ EXPORT_SYMBOL_GPL(blk_register_queue);
|
||||
void blk_unregister_queue(struct gendisk *disk)
|
||||
{
|
||||
struct request_queue *q = disk->queue;
|
||||
bool has_elevator;
|
||||
|
||||
if (WARN_ON(!q))
|
||||
return;
|
||||
@@ -992,6 +993,7 @@ void blk_unregister_queue(struct gendisk *disk)
|
||||
*/
|
||||
mutex_lock(&q->sysfs_lock);
|
||||
blk_queue_flag_clear(QUEUE_FLAG_REGISTERED, q);
|
||||
has_elevator = !!q->elevator;
|
||||
mutex_unlock(&q->sysfs_lock);
|
||||
|
||||
mutex_lock(&q->sysfs_dir_lock);
|
||||
@@ -1007,11 +1009,7 @@ void blk_unregister_queue(struct gendisk *disk)
|
||||
blk_trace_remove_sysfs(disk_to_dev(disk));
|
||||
|
||||
mutex_lock(&q->sysfs_lock);
|
||||
/*
|
||||
* q->kobj has been removed, so it is safe to check if elevator
|
||||
* exists without holding q->sysfs_lock.
|
||||
*/
|
||||
if (q->request_fn || q->elevator)
|
||||
if (q->request_fn || has_elevator)
|
||||
elv_unregister_queue(q);
|
||||
mutex_unlock(&q->sysfs_lock);
|
||||
mutex_unlock(&q->sysfs_dir_lock);
|
||||
|
||||
Reference in New Issue
Block a user