[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191220164632.GA26902@bombadil.infradead.org>
Date: Fri, 20 Dec 2019 08:46:32 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Amir Goldstein <amir73il@...il.com>
Cc: Chris Down <chris@...isdown.name>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Jeff Layton <jlayton@...nel.org>,
Johannes Weiner <hannes@...xchg.org>,
Tejun Heo <tj@...nel.org>,
linux-kernel <linux-kernel@...r.kernel.org>, kernel-team@...com,
Hugh Dickins <hughd@...gle.com>,
Miklos Szeredi <miklos@...redi.hu>,
"zhengbin (A)" <zhengbin13@...wei.com>
Subject: Re: [PATCH] fs: inode: Reduce volatile inode wraparound risk when
ino_t is 64 bit
On Fri, Dec 20, 2019 at 03:41:11PM +0200, Amir Goldstein wrote:
> Suggestion:
> 1. Extend the kmem_cache API to let the ctor() know if it is
> initializing an object
> for the first time (new page) or recycling an object.
Uh, what? The ctor is _only_ called when new pages are allocated.
Part of the contract with the slab user is that objects are returned to
the slab in an initialised state.
> 2. Let shmem_init_inode retain the value of i_ino of recycled shmem_inode_info
> objects
> 3. i_ino is initialized with get_next_ino() only in case it it zero
>
> Alternatively to 1., if simpler to implement and acceptable by slab developers:
> 1.b. remove the assertion from cache_grow_begin()/new_slab_objects():
> WARN_ON_ONCE(s->ctor && (flags & __GFP_ZERO));
> and pass __GFP_ZERO in shmem_alloc_inode()
WTF would that _mean_? I want this object to contain zeroes and whatever
the constructor sets it to. WHich one wins?
Powered by blists - more mailing lists