lkml.org 
[lkml]   [2017]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fs: Safe rcu access to hlist.
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
\
 
 \ /
  Last update: 2017-11-19 21:02    [W:0.076 / U:3.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site