[PATCH] fs: Safe rcu access to hlist.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux