* i_generation = 0 special casing
@ 2004-11-24 9:43 Christoph Hellwig
2004-11-24 12:25 ` Anton Altaparmakov
2004-11-24 22:48 ` Neil Brown
0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2004-11-24 9:43 UTC (permalink / raw)
To: nfs, linux-fsdevel
export_iget (and routines based on it such as xfs_vget) check for
i_generation beeing 0 meaning that every generation is okay. Where in
the NFS code is this wildcard needed?
I had to find out that XFS starts it's i_generation at zero and either
I have to fix up the i_generation or drop this wildcard if it's not
actually used.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: i_generation = 0 special casing
2004-11-24 9:43 i_generation = 0 special casing Christoph Hellwig
@ 2004-11-24 12:25 ` Anton Altaparmakov
2004-11-24 22:48 ` Neil Brown
1 sibling, 0 replies; 3+ messages in thread
From: Anton Altaparmakov @ 2004-11-24 12:25 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: nfs, linux-fsdevel
On Wed, 2004-11-24 at 09:43 +0000, Christoph Hellwig wrote:
> export_iget (and routines based on it such as xfs_vget) check for
> i_generation beeing 0 meaning that every generation is okay. Where in
> the NFS code is this wildcard needed?
I didn't have anything to do with the i_generation handling in NFS but
at least NTFS takes i_generation beeing 0 meaning that every generation
is ok. (That is how Windows NTFS does it so we do the same. It allows
to disable generation checking by setting all i_generations to 0 on a
volume.)
> I had to find out that XFS starts it's i_generation at zero and either
> I have to fix up the i_generation or drop this wildcard if it's not
> actually used.
In NTFS I start i_generation at 1 and when it reaches 0xffff I wrap it
to 1 again, skipping zero. (On disk it is 16 bits on NTFS.)
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: i_generation = 0 special casing
2004-11-24 9:43 i_generation = 0 special casing Christoph Hellwig
2004-11-24 12:25 ` Anton Altaparmakov
@ 2004-11-24 22:48 ` Neil Brown
1 sibling, 0 replies; 3+ messages in thread
From: Neil Brown @ 2004-11-24 22:48 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: nfs, linux-fsdevel
On Wednesday November 24, hch@infradead.org wrote:
> export_iget (and routines based on it such as xfs_vget) check for
> i_generation beeing 0 meaning that every generation is okay. Where in
> the NFS code is this wildcard needed?
On reflection, it is largely a coding convenience :-(
A filehandle can identify both an object, and it's parent directory.
An earlier version of the filehandle (2.2 kernel) contained the
generation number for the object, but not for the parent direction.
To stay compatible with that, we need to cope with not knowing the
generation number.
So the routine that finds a dentry given inode number and generation
number needs to be able to be told "I don't know the generation
number, just accept whatever you find", as that is safe enough when
hunting for the parent directory (if you get the wrong thing by
mistake, you will find out some other way).
To tell the "inum+generation -> dentry" routine "don't worry about the
gernation number", we use a generation number of 0. This obviously
has problems as you have noted.
It should probably be changed to have an explicit "ignore the
generation number" flag, or just possibly require callers to map '0'
to (e.g.) 1 when passing in a genuine generation number (whether for
filehandle creation or lookup).
>
> I had to find out that XFS starts it's i_generation at zero and either
> I have to fix up the i_generation or drop this wildcard if it's not
> actually used.
It would certainly be easiest to simply not have generation numbers
ever being zero, but it isn't a nice requirement to put on a
filesystem.
However I cannot immediately see a real solution that is anything
close to clean. I might try again in a week or so and see if anything
comes to mind.
NeilBrown
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-24 22:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-24 9:43 i_generation = 0 special casing Christoph Hellwig
2004-11-24 12:25 ` Anton Altaparmakov
2004-11-24 22:48 ` Neil Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).