xfs
[Top] [All Lists]

Re: [PATCH] Don't initialise new inode generation numbers to zero V2

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] Don't initialise new inode generation numbers to zero V2
From: Greg Banks <gnb@xxxxxxxxxxxxxxxxx>
Date: Mon, 28 Apr 2008 13:24:20 +1000
Cc: David Chinner <dgc@xxxxxxx>, xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <20080425085750.GA6395@xxxxxxxxxxxxx>
Organization: File Serving Technologies ; Silicon Graphics Inc.
References: <20080422015806.GU108924158@xxxxxxx> <480D641B.8060301@xxxxxxxxxxxxxxxxx> <20080422050447.GV103491721@xxxxxxx> <20080425085750.GA6395@xxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 1.5.0.12 (X11/20060911)
Christoph Hellwig wrote:
> On Tue, Apr 22, 2008 at 03:04:48PM +1000, David Chinner wrote:
>   
>>
>> Christoph, care to explain how and why this is a problem to everyone?
>>     
>
> XFS has some heuristics for inode placement and of course for removing
> the inode cluster and re-allocting it.  I have a gut feeling that there
> is a small chance to trigger a re-use via nfs operations.  
Dave's initial patch -- please correct me if I misunderstood it -- kept
a per-AG counter which was used to initialise the generation number of
new inodes.  This counter incremented every time an inode was created in
that AG, i.e. every mknod() mkdir() or creat() bumps the counter for the
appropriate AG. So it served as a per-AG inode generation number, which
given the fixed mapping between AG and inode# means it's just like a
per-inode generation number but sparser.  Thus the only way you could
cause a re-use of an (inode,gen) tuple would be by cycling through
2^32-1 inode creations anywhere in the same AG before destroying and
re-creating the original inode.  That's as good a protection as 32bits
is going to buy.  So if Dave's first patch works the way I think it
works, it should be just fine for NFS' purposes.  Am I missing something?

-- 
Greg Banks, P.Engineer, SGI Australian Software Group.
The cake is *not* a lie.
I don't speak for SGI.


<Prev in Thread] Current Thread [Next in Thread>