mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brent Pappas <bpappas@pappasbrent.com>
To: "David S. Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Brent Pappas <bpappas@pappasbrent.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ipv6: mcast: Add __must_hold() annotations.
Date: Thu,  8 Aug 2024 15:02:55 -0400	[thread overview]
Message-ID: <20240808190256.149602-1-bpappas@pappasbrent.com> (raw)

Add __must_hold(RCU) annotations to igmp6_mc_get_first(),
igmp6_mc_get_next(), and igmp6_mc_get_idx() to signify that they are
meant to be called in RCU critical sections.

Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
---
 net/ipv6/mcast.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 7ba01d8cfbae..843d0d065242 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -22,6 +22,7 @@
  *		- MLDv2 support
  */
 
+#include "linux/compiler_types.h"
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/types.h>
@@ -2861,6 +2862,7 @@ struct igmp6_mc_iter_state {
 #define igmp6_mc_seq_private(seq)	((struct igmp6_mc_iter_state *)(seq)->private)
 
 static inline struct ifmcaddr6 *igmp6_mc_get_first(struct seq_file *seq)
+	__must_hold(RCU)
 {
 	struct ifmcaddr6 *im = NULL;
 	struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq);
@@ -2882,7 +2884,9 @@ static inline struct ifmcaddr6 *igmp6_mc_get_first(struct seq_file *seq)
 	return im;
 }
 
-static struct ifmcaddr6 *igmp6_mc_get_next(struct seq_file *seq, struct ifmcaddr6 *im)
+static struct ifmcaddr6 *igmp6_mc_get_next(struct seq_file *seq,
+					   struct ifmcaddr6 *im)
+	__must_hold(RCU)
 {
 	struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq);
 
@@ -2902,6 +2906,7 @@ static struct ifmcaddr6 *igmp6_mc_get_next(struct seq_file *seq, struct ifmcaddr
 }
 
 static struct ifmcaddr6 *igmp6_mc_get_idx(struct seq_file *seq, loff_t pos)
+	__must_hold(RCU)
 {
 	struct ifmcaddr6 *im = igmp6_mc_get_first(seq);
 	if (im)
-- 
2.46.0


             reply	other threads:[~2024-08-08 19:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 19:02 Brent Pappas [this message]
2024-08-08 20:23 ` Kuniyuki Iwashima
2024-08-08 23:14   ` Brent Pappas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240808190256.149602-1-bpappas@pappasbrent.com \
    --to=bpappas@pappasbrent.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®