Merge tag 'block-6.12-20241108' of git://git.kernel.dk/linux

Pull block fix from Jens Axboe:
"Single fix for an issue triggered with PROVE_RCU=y, with nvme using
the wrong iterators for an SRCU protected list"

* tag 'block-6.12-20241108' of git://git.kernel.dk/linux:
nvme/host: Fix RCU list traversal to use SRCU primitive

Changed files
+14 -7
drivers
nvme
host
+14 -7
drivers/nvme/host/core.c
··· 3795 3795 int srcu_idx; 3796 3796 3797 3797 srcu_idx = srcu_read_lock(&ctrl->srcu); 3798 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) { 3798 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 3799 + srcu_read_lock_held(&ctrl->srcu)) { 3799 3800 if (ns->head->ns_id == nsid) { 3800 3801 if (!nvme_get_ns(ns)) 3801 3802 continue; ··· 4880 4879 int srcu_idx; 4881 4880 4882 4881 srcu_idx = srcu_read_lock(&ctrl->srcu); 4883 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) 4882 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 4883 + srcu_read_lock_held(&ctrl->srcu)) 4884 4884 blk_mark_disk_dead(ns->disk); 4885 4885 srcu_read_unlock(&ctrl->srcu, srcu_idx); 4886 4886 } ··· 4893 4891 int srcu_idx; 4894 4892 4895 4893 srcu_idx = srcu_read_lock(&ctrl->srcu); 4896 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) 4894 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 4895 + srcu_read_lock_held(&ctrl->srcu)) 4897 4896 blk_mq_unfreeze_queue(ns->queue); 4898 4897 srcu_read_unlock(&ctrl->srcu, srcu_idx); 4899 4898 clear_bit(NVME_CTRL_FROZEN, &ctrl->flags); ··· 4907 4904 int srcu_idx; 4908 4905 4909 4906 srcu_idx = srcu_read_lock(&ctrl->srcu); 4910 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) { 4907 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 4908 + srcu_read_lock_held(&ctrl->srcu)) { 4911 4909 timeout = blk_mq_freeze_queue_wait_timeout(ns->queue, timeout); 4912 4910 if (timeout <= 0) 4913 4911 break; ··· 4924 4920 int srcu_idx; 4925 4921 4926 4922 srcu_idx = srcu_read_lock(&ctrl->srcu); 4927 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) 4923 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 4924 + srcu_read_lock_held(&ctrl->srcu)) 4928 4925 blk_mq_freeze_queue_wait(ns->queue); 4929 4926 srcu_read_unlock(&ctrl->srcu, srcu_idx); 4930 4927 } ··· 4938 4933 4939 4934 set_bit(NVME_CTRL_FROZEN, &ctrl->flags); 4940 4935 srcu_idx = srcu_read_lock(&ctrl->srcu); 4941 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) 4936 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 4937 + srcu_read_lock_held(&ctrl->srcu)) 4942 4938 blk_freeze_queue_start(ns->queue); 4943 4939 srcu_read_unlock(&ctrl->srcu, srcu_idx); 4944 4940 } ··· 4987 4981 int srcu_idx; 4988 4982 4989 4983 srcu_idx = srcu_read_lock(&ctrl->srcu); 4990 - list_for_each_entry_rcu(ns, &ctrl->namespaces, list) 4984 + list_for_each_entry_srcu(ns, &ctrl->namespaces, list, 4985 + srcu_read_lock_held(&ctrl->srcu)) 4991 4986 blk_sync_queue(ns->queue); 4992 4987 srcu_read_unlock(&ctrl->srcu, srcu_idx); 4993 4988 }