From: Jakub Kicinski <kuba@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: netdev@vger.kernel.org, linux-afs@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/7] rxrpc: Fix locking issue
Date: Fri, 20 May 2022 18:11:18 -0700 [thread overview]
Message-ID: <20220520181118.47ca2bdc@kernel.org> (raw)
In-Reply-To: <165306517397.34989.14593967592142268589.stgit@warthog.procyon.org.uk>
On Fri, 20 May 2022 17:46:13 +0100 David Howells wrote:
> +struct list_head *seq_list_start_rcu(struct list_head *head, loff_t pos)
> +{
> + struct list_head *lh;
> +
> + list_for_each_rcu(lh, head)
> + if (pos-- == 0)
> + return lh;
> +
> + return NULL;
> +}
> +EXPORT_SYMBOL(seq_list_start_rcu);
> +
> +struct list_head *seq_list_start_head_rcu(struct list_head *head, loff_t pos)
> +{
> + if (!pos)
> + return head;
> +
> + return seq_list_start_rcu(head, pos - 1);
> +}
> +EXPORT_SYMBOL(seq_list_start_head_rcu);
> +
> +struct list_head *seq_list_next_rcu(void *v, struct list_head *head,
> + loff_t *ppos)
> +{
> + struct list_head *lh;
> +
> + lh = rcu_dereference(((struct list_head *)v)->next);
Can we use list_next_rcu() here maybe ? to avoid the sparse warning?
> + ++*ppos;
> + return lh == head ? NULL : lh;
> +}
> +EXPORT_SYMBOL(seq_list_next_rcu);
next prev parent reply other threads:[~2022-05-21 1:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-20 16:45 [PATCH net-next 0/7] rxrpc: Miscellaneous changes David Howells
2022-05-20 16:46 ` [PATCH net-next 1/7] rxrpc: Allow list of in-use local UDP endpoints to be viewed in /proc David Howells
2022-05-20 16:46 ` [PATCH net-next 2/7] rxrpc: Use refcount_t rather than atomic_t David Howells
2022-05-20 16:46 ` [PATCH net-next 3/7] rxrpc: Fix locking issue David Howells
2022-05-21 1:11 ` Jakub Kicinski [this message]
2022-05-21 7:26 ` David Howells
2022-05-20 16:46 ` [PATCH net-next 4/7] rxrpc: Automatically generate trace tag enums David Howells
2022-05-20 16:46 ` [PATCH net-next 5/7] rxrpc: Return an error to sendmsg if call failed David Howells
2022-05-20 16:46 ` [PATCH net-next 6/7] rxrpc, afs: Fix selection of abort codes David Howells
2022-05-20 16:46 ` [PATCH net-next 7/7] afs: Adjust ACK interpretation to try and cope with NAT David Howells
2022-05-21 7:45 [PATCH net-next 0/7] rxrpc: Miscellaneous changes David Howells
2022-05-21 7:45 ` [PATCH net-next 3/7] rxrpc: Fix locking issue David Howells
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=20220520181118.47ca2bdc@kernel.org \
--to=kuba@kernel.org \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).