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

Christoph Hellwig hch at lst.de
Wed Jun 24 02:37:19 EDT 2020


On Tue, Jun 23, 2020 at 05:18:50PM -0700, Sagi Grimberg wrote:
> 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?



More information about the Linux-nvme mailing list