i_generation = 0 special casing
Subsystems (3)
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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
Quoted 3 lines · Christoph Hellwig
export_iget(and routines based on it such asxfs_vget) check fori_generationbeeing 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.)
Quoted 3 lines
I had to find out that XFS starts it's
i_generationat zero and either I have to fix up thei_generationor 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
Signature · 4 lines
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/
Quoted 3 lines · On Wednesday November 24, [email protected] wrote:
export_iget(and routines based on it such asxfs_vget) check fori_generationbeeing 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).
Quoted 4 lines
I had to find out that XFS starts it's
i_generationat zero and either I have to fix up thei_generationor 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 - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs