Re: [PATCH] rbtree: clarify documentation of rbtree_postorder_for_each_entry_safe()

2015-10-06 Thread Tejun Heo
Hello, On Sun, Oct 04, 2015 at 06:32:50PM -0400, Cody P Schafer wrote: > Doing this will cause random nodes to be missed by the iteration because > rb_erase() may rebalance the tree, changing the ordering that we're > trying to iterate over. > > The previous documentation for rbtree_postorder_for

[PATCH] rbtree: clarify documentation of rbtree_postorder_for_each_entry_safe()

2015-10-04 Thread Cody P Schafer
Noticed that commit a20135ffbc44 ("writeback: don't drain bdi_writeback_congested on bdi destruction") added a usage of rbtree_postorder_for_each_entry_safe() in mm/backing-dev.c which appears to try to rb_erase() elements from an rbtree while iterating over it using rbtree_postorder_for_each_entry