[PATCH] nvme: fix (S)RCU protection of nvme_ns_head list (alternate)

Sagi Grimberg sagi at grimberg.me
Wed Nov 30 00:25:19 PST 2022


>> +++ b/drivers/nvme/host/multipath.c
>> @@ -175,10 +175,12 @@ void nvme_mpath_revalidate_paths(struct nvme_ns *ns)
>>   	sector_t capacity = get_capacity(head->disk);
>>   	int node;
>>   
>> +	rcu_read_lock();
>>   	list_for_each_entry_rcu(ns, &head->list, siblings) {
>>   		if (capacity != get_capacity(ns->disk))
>>   			clear_bit(NVME_NS_READY, &ns->flags);
>>   	}
>> +	rcu_read_unlock();
> 
> I can't see how protection iteraction of the same list once with
> SRCU and once with RCU can work in practice.

I understand what you mean in general, but in this particular case
I don't understand what is not working.

But, if this is too confusing we can make everything srcu protected
and be done with it.



More information about the Linux-nvme mailing list