On Wed, Jun 15, 2022 at 02:48:25PM +0800, Ming Lei wrote: > q->elevator is referred in blk_mq_has_sqsched() without any protection, > no .q_usage_counter is held, no queue srcu and rcu read lock is held, > so potential use-after-free may be triggered. > > Fix the issue by adding one queue flag for checking if the elevator > uses single queue style dispatch. Meantime the elevator feature flag > of ELEVATOR_F_MQ_AWARE isn't needed any more. We still need to clear the flag when switching elevators.