[PATCH v2 for-5.8-rc 3/6] nvme: don't protect ns mutation with ns->head->lock

Sagi Grimberg sagi at grimberg.me
Wed Jun 24 02:58:28 EDT 2020


>> Right now ns->head->lock is protecting namespace mutation
>> which is wrong and unneeded. Move it to only protect
>> against head mutations. While we're at it, remove unnecessary
>> ns->head reference as we already have head pointer.
> 
> The changes look reasonable (nitpick below), but this changelog doesn't
> sway what the problem is and how it it fixed.
> 
>> -	synchronize_srcu(&ns->head->srcu);
>> -	kblockd_schedule_work(&ns->head->requeue_work);
>> +	synchronize_srcu(&head->srcu);
>> +	kblockd_schedule_work(&head->requeue_work);
>> +	mutex_unlock(&head->lock);
> 
> Can't we move the synchronize_srcu and kblockd_schedule_work out of
> the lock as well?

the requeue_work kick for sure, and I think also the synchronize given
that the actual critical section is protected...

Will fix.



More information about the Linux-nvme mailing list