Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nstree: simplify owner list iteration

Make use of list_for_each_entry_from_rcu().

Link: https://patch.msgid.link/20251110-work-namespace-nstree-fixes-v1-6-e8a9264e0fb9@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+7 -3
+7 -3
kernel/nstree.c
··· 598 598 rcu_read_lock(); 599 599 600 600 if (!first_ns) 601 - first_ns = list_entry_rcu(head->next, typeof(*ns), ns_owner_node.ns_list_entry); 602 - for (ns = first_ns; &ns->ns_owner_node.ns_list_entry != head && nr_ns_ids; 603 - ns = list_entry_rcu(ns->ns_owner_node.ns_list_entry.next, typeof(*ns), ns_owner_node.ns_list_entry)) { 601 + first_ns = list_entry_rcu(head->next, typeof(*first_ns), ns_owner_node.ns_list_entry); 602 + 603 + ns = first_ns; 604 + list_for_each_entry_from_rcu(ns, head, ns_owner_node.ns_list_entry) { 604 605 struct ns_common *valid; 606 + 607 + if (!nr_ns_ids) 608 + break; 605 609 606 610 valid = legitimize_ns(kls, ns); 607 611 if (!valid)