[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190815161211.GC588936@devbig004.ftw2.facebook.com>
Date: Thu, 15 Aug 2019 09:12:11 -0700
From: Tejun Heo <tj@...nel.org>
To: Jan Kara <jack@...e.cz>
Cc: axboe@...nel.dk, hannes@...xchg.org, mhocko@...nel.org,
vdavydov.dev@...il.com, cgroups@...r.kernel.org,
linux-mm@...ck.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-team@...com, guro@...com,
akpm@...ux-foundation.org
Subject: Re: [PATCH 3/4] writeback, memcg: Implement cgroup_writeback_by_id()
On Thu, Aug 15, 2019 at 04:54:21PM +0200, Jan Kara wrote:
> > + /* and find the associated wb */
> > + wb = wb_get_create(bdi, memcg_css, GFP_NOWAIT | __GFP_NOWARN);
> > + if (!wb) {
> > + ret = -ENOMEM;
> > + goto out_css_put;
> > + }
>
> One more thought: You don't want the "_create" part here, do you? If
> there's any point in writing back using this wb, it must be attached to
> some inode and thus it must exist. In the normal case wb_get_create() will
> just fetch the reference and be done with it but when you feed garbage into
> this function due to id going stale or frn structures getting corrupted due
> to concurrent access, you can be creating bogus wb structures in bdi...
Yeah, it can create wbs unnecessarily which isn't critical but also is
easy to fix. Will update.
Thanks.
--
tejun
Powered by blists - more mailing lists