Commit b33e18f6 authored by Tejun Heo's avatar Tejun Heo Committed by Ingo Molnar

fs/writeback, rcu: Don't use list_entry_rcu() for pointer offsetting in bdi_split_work_to_wbs()

bdi_split_work_to_wbs() uses list_for_each_entry_rcu_continue()
to walk @bdi->wb_list.  To set up the initial iteration
condition, it uses list_entry_rcu() to calculate the entry
pointer corresponding to the list head; however, this isn't an
actual RCU dereference and using list_entry_rcu() for it ended
up breaking a proposed list_entry_rcu() change because it was
feeding an non-lvalue pointer into the macro.

Don't use the RCU variant for simple pointer offsetting.  Use
list_entry() instead.
Reported-by: default avatarIngo Molnar <>
Signed-off-by: default avatarTejun Heo <>
Cc: Darren Hart <>
Cc: David Howells <>
Cc: Dipankar Sarma <>
Cc: Eric Dumazet <>
Cc: Frederic Weisbecker <>
Cc: Josh Triplett <>
Cc: Lai Jiangshan <>
Cc: Linus Torvalds <>
Cc: Mathieu Desnoyers <>
Cc: Oleg Nesterov <>
Cc: Patrick Marlier <>
Cc: Paul McKenney <>
Cc: Peter Zijlstra <>
Cc: Steven Rostedt <>
Cc: Thomas Gleixner <>
Cc: pranith kumar <>
Link: default avatarIngo Molnar <>
parent e4340bbb
......@@ -779,8 +779,8 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi,
bool skip_if_busy)
struct bdi_writeback *last_wb = NULL;
struct bdi_writeback *wb = list_entry_rcu(&bdi->wb_list,
struct bdi_writeback, bdi_node);
struct bdi_writeback *wb = list_entry(&bdi->wb_list,
struct bdi_writeback, bdi_node);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment