[RFC PATCH] nvme: use NS head lock to serialize access to NS list
John Garry
john.g.garry at oracle.com
Mon Jan 26 10:22:13 PST 2026
On 26/01/2026 17:08, Keith Busch wrote:
> On Mon, Jan 26, 2026 at 04:45:52PM +0000, John Garry wrote:
>> @@ -702,12 +702,12 @@ static void nvme_remove_head_work(struct work_struct *work)
>> struct nvme_ns_head, remove_work);
>> bool remove = false;
>>
>> - mutex_lock(&head->subsys->lock);
>> + mutex_lock(&head->lock);
>> if (list_empty(&head->list)) {
>> list_del_init(&head->entry);
>
> The head->entry is linked into the subsystem's "nsheads" list, so at
> least access to that still needs to happen under the subsys->lock.
>
Ah, yes, I overlooked that.
> The other lock changes constrained to the head->list usage look fine.
ok, thanks
More information about the Linux-nvme
mailing list