Skip to content
Commit e27c5b9d authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

writeback: remove broken rbtree_postorder_for_each_entry_safe() usage in cgwb_bdi_destroy()



a20135ff ("writeback: don't drain bdi_writeback_congested on bdi
destruction") added rbtree_postorder_for_each_entry_safe() which is
used to remove all entries; however, according to Cody, the iterator
isn't safe against operations which may rebalance the tree.  Fix it by
switching to repeatedly removing rb_first() until empty.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarCody P Schafer <dev@codyps.com>
Fixes: a20135ff ("writeback: don't drain bdi_writeback_congested on bdi destruction")
Link: http://lkml.kernel.org/g/1443997973-1700-1-git-send-email-dev@codyps.com


Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 0dfc70c3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment