diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ila/ila_xlat.c | 4 | ||||
-rw-r--r-- | net/ipv6/seg6.c | 4 | ||||
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 34 | ||||
-rw-r--r-- | net/netfilter/nft_set_hash.c | 10 | ||||
-rw-r--r-- | net/netlink/af_netlink.c | 5 | ||||
-rw-r--r-- | net/netlink/diag.c | 8 | ||||
-rw-r--r-- | net/sctp/proc.c | 6 | ||||
-rw-r--r-- | net/sctp/socket.c | 19 | ||||
-rw-r--r-- | net/tipc/socket.c | 6 |
9 files changed, 26 insertions, 70 deletions
diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c index 6eb5e68f112a..44c39c5f0638 100644 --- a/net/ipv6/ila/ila_xlat.c +++ b/net/ipv6/ila/ila_xlat.c | |||
@@ -512,9 +512,7 @@ static int ila_nl_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
512 | struct ila_map *ila; | 512 | struct ila_map *ila; |
513 | int ret; | 513 | int ret; |
514 | 514 | ||
515 | ret = rhashtable_walk_start(rhiter); | 515 | rhashtable_walk_start(rhiter); |
516 | if (ret && ret != -EAGAIN) | ||
517 | goto done; | ||
518 | 516 | ||
519 | for (;;) { | 517 | for (;;) { |
520 | ila = rhashtable_walk_next(rhiter); | 518 | ila = rhashtable_walk_next(rhiter); |
diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index c81407770956..7f5621d09571 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c | |||
@@ -306,9 +306,7 @@ static int seg6_genl_dumphmac(struct sk_buff *skb, struct netlink_callback *cb) | |||
306 | struct seg6_hmac_info *hinfo; | 306 | struct seg6_hmac_info *hinfo; |
307 | int ret; | 307 | int ret; |
308 | 308 | ||
309 | ret = rhashtable_walk_start(iter); | 309 | rhashtable_walk_start(iter); |
310 | if (ret && ret != -EAGAIN) | ||
311 | goto done; | ||
312 | 310 | ||
313 | for (;;) { | 311 | for (;;) { |
314 | hinfo = rhashtable_walk_next(iter); | 312 | hinfo = rhashtable_walk_next(iter); |
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 86c8dfef56a4..a5125624a76d 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -257,9 +257,7 @@ __mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx) | |||
257 | if (ret) | 257 | if (ret) |
258 | return NULL; | 258 | return NULL; |
259 | 259 | ||
260 | ret = rhashtable_walk_start(&iter); | 260 | rhashtable_walk_start(&iter); |
261 | if (ret && ret != -EAGAIN) | ||
262 | goto err; | ||
263 | 261 | ||
264 | while ((mpath = rhashtable_walk_next(&iter))) { | 262 | while ((mpath = rhashtable_walk_next(&iter))) { |
265 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) | 263 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) |
@@ -269,7 +267,6 @@ __mesh_path_lookup_by_idx(struct mesh_table *tbl, int idx) | |||
269 | if (i++ == idx) | 267 | if (i++ == idx) |
270 | break; | 268 | break; |
271 | } | 269 | } |
272 | err: | ||
273 | rhashtable_walk_stop(&iter); | 270 | rhashtable_walk_stop(&iter); |
274 | rhashtable_walk_exit(&iter); | 271 | rhashtable_walk_exit(&iter); |
275 | 272 | ||
@@ -513,9 +510,7 @@ void mesh_plink_broken(struct sta_info *sta) | |||
513 | if (ret) | 510 | if (ret) |
514 | return; | 511 | return; |
515 | 512 | ||
516 | ret = rhashtable_walk_start(&iter); | 513 | rhashtable_walk_start(&iter); |
517 | if (ret && ret != -EAGAIN) | ||
518 | goto out; | ||
519 | 514 | ||
520 | while ((mpath = rhashtable_walk_next(&iter))) { | 515 | while ((mpath = rhashtable_walk_next(&iter))) { |
521 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) | 516 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) |
@@ -535,7 +530,6 @@ void mesh_plink_broken(struct sta_info *sta) | |||
535 | WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast); | 530 | WLAN_REASON_MESH_PATH_DEST_UNREACHABLE, bcast); |
536 | } | 531 | } |
537 | } | 532 | } |
538 | out: | ||
539 | rhashtable_walk_stop(&iter); | 533 | rhashtable_walk_stop(&iter); |
540 | rhashtable_walk_exit(&iter); | 534 | rhashtable_walk_exit(&iter); |
541 | } | 535 | } |
@@ -584,9 +578,7 @@ void mesh_path_flush_by_nexthop(struct sta_info *sta) | |||
584 | if (ret) | 578 | if (ret) |
585 | return; | 579 | return; |
586 | 580 | ||
587 | ret = rhashtable_walk_start(&iter); | 581 | rhashtable_walk_start(&iter); |
588 | if (ret && ret != -EAGAIN) | ||
589 | goto out; | ||
590 | 582 | ||
591 | while ((mpath = rhashtable_walk_next(&iter))) { | 583 | while ((mpath = rhashtable_walk_next(&iter))) { |
592 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) | 584 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) |
@@ -597,7 +589,7 @@ void mesh_path_flush_by_nexthop(struct sta_info *sta) | |||
597 | if (rcu_access_pointer(mpath->next_hop) == sta) | 589 | if (rcu_access_pointer(mpath->next_hop) == sta) |
598 | __mesh_path_del(tbl, mpath); | 590 | __mesh_path_del(tbl, mpath); |
599 | } | 591 | } |
600 | out: | 592 | |
601 | rhashtable_walk_stop(&iter); | 593 | rhashtable_walk_stop(&iter); |
602 | rhashtable_walk_exit(&iter); | 594 | rhashtable_walk_exit(&iter); |
603 | } | 595 | } |
@@ -614,9 +606,7 @@ static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata, | |||
614 | if (ret) | 606 | if (ret) |
615 | return; | 607 | return; |
616 | 608 | ||
617 | ret = rhashtable_walk_start(&iter); | 609 | rhashtable_walk_start(&iter); |
618 | if (ret && ret != -EAGAIN) | ||
619 | goto out; | ||
620 | 610 | ||
621 | while ((mpath = rhashtable_walk_next(&iter))) { | 611 | while ((mpath = rhashtable_walk_next(&iter))) { |
622 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) | 612 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) |
@@ -627,7 +617,7 @@ static void mpp_flush_by_proxy(struct ieee80211_sub_if_data *sdata, | |||
627 | if (ether_addr_equal(mpath->mpp, proxy)) | 617 | if (ether_addr_equal(mpath->mpp, proxy)) |
628 | __mesh_path_del(tbl, mpath); | 618 | __mesh_path_del(tbl, mpath); |
629 | } | 619 | } |
630 | out: | 620 | |
631 | rhashtable_walk_stop(&iter); | 621 | rhashtable_walk_stop(&iter); |
632 | rhashtable_walk_exit(&iter); | 622 | rhashtable_walk_exit(&iter); |
633 | } | 623 | } |
@@ -642,9 +632,7 @@ static void table_flush_by_iface(struct mesh_table *tbl) | |||
642 | if (ret) | 632 | if (ret) |
643 | return; | 633 | return; |
644 | 634 | ||
645 | ret = rhashtable_walk_start(&iter); | 635 | rhashtable_walk_start(&iter); |
646 | if (ret && ret != -EAGAIN) | ||
647 | goto out; | ||
648 | 636 | ||
649 | while ((mpath = rhashtable_walk_next(&iter))) { | 637 | while ((mpath = rhashtable_walk_next(&iter))) { |
650 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) | 638 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) |
@@ -653,7 +641,7 @@ static void table_flush_by_iface(struct mesh_table *tbl) | |||
653 | break; | 641 | break; |
654 | __mesh_path_del(tbl, mpath); | 642 | __mesh_path_del(tbl, mpath); |
655 | } | 643 | } |
656 | out: | 644 | |
657 | rhashtable_walk_stop(&iter); | 645 | rhashtable_walk_stop(&iter); |
658 | rhashtable_walk_exit(&iter); | 646 | rhashtable_walk_exit(&iter); |
659 | } | 647 | } |
@@ -873,9 +861,7 @@ void mesh_path_tbl_expire(struct ieee80211_sub_if_data *sdata, | |||
873 | if (ret) | 861 | if (ret) |
874 | return; | 862 | return; |
875 | 863 | ||
876 | ret = rhashtable_walk_start(&iter); | 864 | rhashtable_walk_start(&iter); |
877 | if (ret && ret != -EAGAIN) | ||
878 | goto out; | ||
879 | 865 | ||
880 | while ((mpath = rhashtable_walk_next(&iter))) { | 866 | while ((mpath = rhashtable_walk_next(&iter))) { |
881 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) | 867 | if (IS_ERR(mpath) && PTR_ERR(mpath) == -EAGAIN) |
@@ -887,7 +873,7 @@ void mesh_path_tbl_expire(struct ieee80211_sub_if_data *sdata, | |||
887 | time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE)) | 873 | time_after(jiffies, mpath->exp_time + MESH_PATH_EXPIRE)) |
888 | __mesh_path_del(tbl, mpath); | 874 | __mesh_path_del(tbl, mpath); |
889 | } | 875 | } |
890 | out: | 876 | |
891 | rhashtable_walk_stop(&iter); | 877 | rhashtable_walk_stop(&iter); |
892 | rhashtable_walk_exit(&iter); | 878 | rhashtable_walk_exit(&iter); |
893 | } | 879 | } |
diff --git a/net/netfilter/nft_set_hash.c b/net/netfilter/nft_set_hash.c index f8166c1d5430..3f1624ee056f 100644 --- a/net/netfilter/nft_set_hash.c +++ b/net/netfilter/nft_set_hash.c | |||
@@ -251,11 +251,7 @@ static void nft_rhash_walk(const struct nft_ctx *ctx, struct nft_set *set, | |||
251 | if (err) | 251 | if (err) |
252 | return; | 252 | return; |
253 | 253 | ||
254 | err = rhashtable_walk_start(&hti); | 254 | rhashtable_walk_start(&hti); |
255 | if (err && err != -EAGAIN) { | ||
256 | iter->err = err; | ||
257 | goto out; | ||
258 | } | ||
259 | 255 | ||
260 | while ((he = rhashtable_walk_next(&hti))) { | 256 | while ((he = rhashtable_walk_next(&hti))) { |
261 | if (IS_ERR(he)) { | 257 | if (IS_ERR(he)) { |
@@ -306,9 +302,7 @@ static void nft_rhash_gc(struct work_struct *work) | |||
306 | if (err) | 302 | if (err) |
307 | goto schedule; | 303 | goto schedule; |
308 | 304 | ||
309 | err = rhashtable_walk_start(&hti); | 305 | rhashtable_walk_start(&hti); |
310 | if (err && err != -EAGAIN) | ||
311 | goto out; | ||
312 | 306 | ||
313 | while ((he = rhashtable_walk_next(&hti))) { | 307 | while ((he = rhashtable_walk_next(&hti))) { |
314 | if (IS_ERR(he)) { | 308 | if (IS_ERR(he)) { |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index b9e0ee4e22f5..ab325d4d6fef 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -2478,8 +2478,9 @@ static int netlink_walk_start(struct nl_seq_iter *iter) | |||
2478 | return err; | 2478 | return err; |
2479 | } | 2479 | } |
2480 | 2480 | ||
2481 | err = rhashtable_walk_start(&iter->hti); | 2481 | rhashtable_walk_start(&iter->hti); |
2482 | return err == -EAGAIN ? 0 : err; | 2482 | |
2483 | return 0; | ||
2483 | } | 2484 | } |
2484 | 2485 | ||
2485 | static void netlink_walk_stop(struct nl_seq_iter *iter) | 2486 | static void netlink_walk_stop(struct nl_seq_iter *iter) |
diff --git a/net/netlink/diag.c b/net/netlink/diag.c index 8faa20b4d457..7dda33b9b784 100644 --- a/net/netlink/diag.c +++ b/net/netlink/diag.c | |||
@@ -115,11 +115,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, | |||
115 | if (!s_num) | 115 | if (!s_num) |
116 | rhashtable_walk_enter(&tbl->hash, hti); | 116 | rhashtable_walk_enter(&tbl->hash, hti); |
117 | 117 | ||
118 | ret = rhashtable_walk_start(hti); | 118 | rhashtable_walk_start(hti); |
119 | if (ret == -EAGAIN) | ||
120 | ret = 0; | ||
121 | if (ret) | ||
122 | goto stop; | ||
123 | 119 | ||
124 | while ((nlsk = rhashtable_walk_next(hti))) { | 120 | while ((nlsk = rhashtable_walk_next(hti))) { |
125 | if (IS_ERR(nlsk)) { | 121 | if (IS_ERR(nlsk)) { |
@@ -146,8 +142,8 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, | |||
146 | } | 142 | } |
147 | } | 143 | } |
148 | 144 | ||
149 | stop: | ||
150 | rhashtable_walk_stop(hti); | 145 | rhashtable_walk_stop(hti); |
146 | |||
151 | if (ret) | 147 | if (ret) |
152 | goto done; | 148 | goto done; |
153 | 149 | ||
diff --git a/net/sctp/proc.c b/net/sctp/proc.c index 26b4be6b4172..4545bc2aff84 100644 --- a/net/sctp/proc.c +++ b/net/sctp/proc.c | |||
@@ -288,12 +288,8 @@ struct sctp_ht_iter { | |||
288 | static void *sctp_transport_seq_start(struct seq_file *seq, loff_t *pos) | 288 | static void *sctp_transport_seq_start(struct seq_file *seq, loff_t *pos) |
289 | { | 289 | { |
290 | struct sctp_ht_iter *iter = seq->private; | 290 | struct sctp_ht_iter *iter = seq->private; |
291 | int err = sctp_transport_walk_start(&iter->hti); | ||
292 | 291 | ||
293 | if (err) { | 292 | sctp_transport_walk_start(&iter->hti); |
294 | iter->start_fail = 1; | ||
295 | return ERR_PTR(err); | ||
296 | } | ||
297 | 293 | ||
298 | iter->start_fail = 0; | 294 | iter->start_fail = 0; |
299 | return sctp_transport_get_idx(seq_file_net(seq), &iter->hti, *pos); | 295 | return sctp_transport_get_idx(seq_file_net(seq), &iter->hti, *pos); |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index eb17a911aa29..3e55daa37e66 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -4676,20 +4676,11 @@ int sctp_get_sctp_info(struct sock *sk, struct sctp_association *asoc, | |||
4676 | EXPORT_SYMBOL_GPL(sctp_get_sctp_info); | 4676 | EXPORT_SYMBOL_GPL(sctp_get_sctp_info); |
4677 | 4677 | ||
4678 | /* use callback to avoid exporting the core structure */ | 4678 | /* use callback to avoid exporting the core structure */ |
4679 | int sctp_transport_walk_start(struct rhashtable_iter *iter) | 4679 | void sctp_transport_walk_start(struct rhashtable_iter *iter) |
4680 | { | 4680 | { |
4681 | int err; | ||
4682 | |||
4683 | rhltable_walk_enter(&sctp_transport_hashtable, iter); | 4681 | rhltable_walk_enter(&sctp_transport_hashtable, iter); |
4684 | 4682 | ||
4685 | err = rhashtable_walk_start(iter); | 4683 | rhashtable_walk_start(iter); |
4686 | if (err && err != -EAGAIN) { | ||
4687 | rhashtable_walk_stop(iter); | ||
4688 | rhashtable_walk_exit(iter); | ||
4689 | return err; | ||
4690 | } | ||
4691 | |||
4692 | return 0; | ||
4693 | } | 4684 | } |
4694 | 4685 | ||
4695 | void sctp_transport_walk_stop(struct rhashtable_iter *iter) | 4686 | void sctp_transport_walk_stop(struct rhashtable_iter *iter) |
@@ -4780,12 +4771,10 @@ int sctp_for_each_transport(int (*cb)(struct sctp_transport *, void *), | |||
4780 | struct net *net, int *pos, void *p) { | 4771 | struct net *net, int *pos, void *p) { |
4781 | struct rhashtable_iter hti; | 4772 | struct rhashtable_iter hti; |
4782 | struct sctp_transport *tsp; | 4773 | struct sctp_transport *tsp; |
4783 | int ret; | 4774 | int ret = 0; |
4784 | 4775 | ||
4785 | again: | 4776 | again: |
4786 | ret = sctp_transport_walk_start(&hti); | 4777 | sctp_transport_walk_start(&hti); |
4787 | if (ret) | ||
4788 | return ret; | ||
4789 | 4778 | ||
4790 | tsp = sctp_transport_get_idx(net, &hti, *pos + 1); | 4779 | tsp = sctp_transport_get_idx(net, &hti, *pos + 1); |
4791 | for (; !IS_ERR_OR_NULL(tsp); tsp = sctp_transport_get_next(net, &hti)) { | 4780 | for (; !IS_ERR_OR_NULL(tsp); tsp = sctp_transport_get_next(net, &hti)) { |
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 5d18c0caa92b..22c4fd8a9dfe 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -2640,9 +2640,7 @@ void tipc_sk_reinit(struct net *net) | |||
2640 | rhashtable_walk_enter(&tn->sk_rht, &iter); | 2640 | rhashtable_walk_enter(&tn->sk_rht, &iter); |
2641 | 2641 | ||
2642 | do { | 2642 | do { |
2643 | tsk = ERR_PTR(rhashtable_walk_start(&iter)); | 2643 | rhashtable_walk_start(&iter); |
2644 | if (IS_ERR(tsk)) | ||
2645 | goto walk_stop; | ||
2646 | 2644 | ||
2647 | while ((tsk = rhashtable_walk_next(&iter)) && !IS_ERR(tsk)) { | 2645 | while ((tsk = rhashtable_walk_next(&iter)) && !IS_ERR(tsk)) { |
2648 | spin_lock_bh(&tsk->sk.sk_lock.slock); | 2646 | spin_lock_bh(&tsk->sk.sk_lock.slock); |
@@ -2651,7 +2649,7 @@ void tipc_sk_reinit(struct net *net) | |||
2651 | msg_set_orignode(msg, tn->own_addr); | 2649 | msg_set_orignode(msg, tn->own_addr); |
2652 | spin_unlock_bh(&tsk->sk.sk_lock.slock); | 2650 | spin_unlock_bh(&tsk->sk.sk_lock.slock); |
2653 | } | 2651 | } |
2654 | walk_stop: | 2652 | |
2655 | rhashtable_walk_stop(&iter); | 2653 | rhashtable_walk_stop(&iter); |
2656 | } while (tsk == ERR_PTR(-EAGAIN)); | 2654 | } while (tsk == ERR_PTR(-EAGAIN)); |
2657 | } | 2655 | } |