Re: 回复: Re: 回复: Re: [PATCH v1] block/mq-deadline: hold elevator_lock in debugfs next_rq show

From: Bart Van Assche

Date: Thu Jul 23 2026 - 13:44:58 EST


On 7/22/26 7:37 PM, 刘喜鑫 wrote:
That approach did not take effect, so I switched to the current patch.

I have verified the current patch, and the KASAN crash is gone with it.

The following is missing from your patch:
- An explanation why q->elevator_lock is locked instead of dd->lock. I
think that you are misunderstanding the purpose of these locks.
- An explanation why locking q->elevator_lock from inside a debugfs
attribute neither triggers lock inversion nor a deadlock.
- An explanation why the dd and per_prio assignments happen with the
lock held. This seems unnecessary to me because neither
e->elevator_data nor the address of dd->per_prio[] are modified while
the mq-deadline debugfs attributes exist. Did I perhaps overlook
something?

Bart.