From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936998AbdEWTUF (ORCPT ); Tue, 23 May 2017 15:20:05 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:35482 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933470AbdEWTUC (ORCPT ); Tue, 23 May 2017 15:20:02 -0400 Date: Tue, 23 May 2017 15:20:00 -0400 From: Tejun Heo To: Shaohua Li Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk, Kernel-team@fb.com Subject: Re: [PATCH 1/5] kernfs: implement i_generation Message-ID: <20170523192000.GE13222@htj.duckdns.org> References: <1840aeeff2e745d223b01514a433b4b7f20040a6.1495490800.git.shli@fb.com> <20170523074112.GD29525@infradead.org> <20170523150946.GA6123@smirco-mbp.DHCP.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170523150946.GA6123@smirco-mbp.DHCP.thefacebook.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Tue, May 23, 2017 at 08:09:48AM -0700, Shaohua Li wrote: > > i_generation is only supposed to be valid on a per-inode basis, so this > > global counter seems really odd. > > What's the difference between per-inode or per-super? The i_generation doesn't > need to be consecutive for an inode. I checked other fs, a lot of filesystems > implement i_generation in this way, for example, f2fs, ext4. One worry is that it is reasonably possible to wrap on the generation number. Some setups go through cgroups really fast and wrapping 2^32 on the number of files ever created isn't that difficult over time. This actually showing up as a malfunction would be very low probabilty but is still nasty. It'd be nice to give out unique 64bit id for each kn but then we can't use idr. rbtree or extensible hash should work, right? Thanks. -- tejun