nvme: fix SRCU protection of nvme_ns_head list
[linux-2.6-microblaze.git] / drivers / nvme / host / multipath.c
index 93e2138..7e025b8 100644 (file)
@@ -174,11 +174,14 @@ void nvme_mpath_revalidate_paths(struct nvme_ns *ns)
        struct nvme_ns_head *head = ns->head;
        sector_t capacity = get_capacity(head->disk);
        int node;
+       int srcu_idx;
 
+       srcu_idx = srcu_read_lock(&head->srcu);
        list_for_each_entry_rcu(ns, &head->list, siblings) {
                if (capacity != get_capacity(ns->disk))
                        clear_bit(NVME_NS_READY, &ns->flags);
        }
+       srcu_read_unlock(&head->srcu, srcu_idx);
 
        for_each_node(node)
                rcu_assign_pointer(head->current_path[node], NULL);