-
Tejun Heo authored
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:
Tejun Heo <tj@kernel.org> Reported-by:
Cody 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.comSigned-off-by:
Jens Axboe <axboe@fb.com>
e27c5b9d