summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/multipath.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-12-02 08:01:06 -0700
committerJens Axboe <axboe@kernel.dk>2022-12-02 08:01:06 -0700
commitd0f411c0b9bdef85f647e15a2fcc790b29891f2c (patch)
tree3beda37d611a5015e83b5fb3eed15c361c3436c4 /drivers/nvme/host/multipath.c
parent7d4a93176e0142ce16d23c849a47d5b00b856296 (diff)
parent899d2a05dc14733cfba6224083c6b0dd5a738590 (diff)
Merge tag 'nvme-6.1-2022-01-02' of git://git.infradead.org/nvme into block-6.1block-6.1-2022-12-02
Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.1 - fix SRCU protection of nvme_ns_head list (Caleb Sander) - clear the prp2 field when not used (Lei Rao)" * tag 'nvme-6.1-2022-01-02' of git://git.infradead.org/nvme: nvme: fix SRCU protection of nvme_ns_head list nvme-pci: clear the prp2 field when not used
Diffstat (limited to 'drivers/nvme/host/multipath.c')
-rw-r--r--drivers/nvme/host/multipath.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 93e2138a8b42..7e025b8948cb 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -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);