Re: [PATCH v3] writeback: fix obtain a reference to a freeing memcg css

2021-04-04 Thread Tejun Heo
On Fri, Apr 02, 2021 at 05:11:45PM +0800, Muchun Song wrote: > The caller of wb_get_create() should pin the memcg, because > wb_get_create() relies on this guarantee. The rcu read lock > only can guarantee that the memcg css returned by css_from_id() > cannot be released, but the reference of the m

[PATCH v3] writeback: fix obtain a reference to a freeing memcg css

2021-04-02 Thread Muchun Song
The caller of wb_get_create() should pin the memcg, because wb_get_create() relies on this guarantee. The rcu read lock only can guarantee that the memcg css returned by css_from_id() cannot be released, but the reference of the memcg can be zero. rcu_read_lock() memcg_css = css_from_id() wb