linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: Safe rcu access to hlist.
@ 2017-11-19 20:02 Tim Hansen
  2017-11-19 21:28 ` Al Viro
  0 siblings, 1 reply; 7+ messages in thread
From: Tim Hansen @ 2017-11-19 20:02 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, devtimhansen

Adds hlist_first_rcu and hlist_next_rcu for safe access
to the hlist in seq_hlist_next_rcu.

Found on linux-next branch, tag next-20171117 with sparse.

Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
---
 fs/seq_file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index fb17f35a49a6..0b966781fd60 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -968,9 +968,9 @@ struct hlist_node *seq_hlist_next_rcu(void *v,
 
 	++*ppos;
 	if (v == SEQ_START_TOKEN)
-		return rcu_dereference(head->first);
+		return rcu_dereference(hlist_first_rcu(head));
 	else
-		return rcu_dereference(node->next);
+		return rcu_dereference(hlist_next_rcu(node));
 }
 EXPORT_SYMBOL(seq_hlist_next_rcu);
 
-- 
2.15.0.rc0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-11-20 21:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-19 20:02 [PATCH] fs: Safe rcu access to hlist Tim Hansen
2017-11-19 21:28 ` Al Viro
2017-11-20 18:55   ` Tim Hansen
2017-11-20 20:01     ` Luc Van Oostenryck
2017-11-20 20:42       ` Matthew Wilcox
2017-11-20 20:58         ` Luc Van Oostenryck
2017-11-20 21:21           ` Paul E. McKenney

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).