fs/writeback, rcu: Don't use list_entry_rcu() for pointer offsetting in bdi_split_wor...
authorTejun Heo <[email protected]>
Tue, 27 Oct 2015 05:19:39 +0000 (14:19 +0900)
committerIngo Molnar <[email protected]>
Wed, 28 Oct 2015 12:17:30 +0000 (13:17 +0100)
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: Ingo Molnar <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Cc: Darren Hart <[email protected]>
Cc: David Howells <[email protected]>
Cc: Dipankar Sarma <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Josh Triplett <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Patrick Marlier <[email protected]>
Cc: Paul McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: pranith kumar <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
fs/fs-writeback.c

index 29e4599f6fc1c20b73acb2c580ce8383e169c5f2..7378169e90be6ed485ac48d0cf633c8e37c4c3d2 100644 (file)
@@ -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);
 
        might_sleep();
 restart: