Re: [PATCH 1/3] new_inode_autonum: add per-sb lastino counter andadd new_inode_autonum function that guarantees i_ino uniqueness
From: Eric Sandeen
Date: Thu Nov 09 2006 - 12:13:26 EST
Jeff Layton wrote:
> - add a new per superblock s_nextino counter and change iunique to use it
> instead of its global inode counter
> - make the size of the counter conditional on CONFIG_COMPAT. This is to try
> prevent userspace EOVERFLOWs when 32-bit programs not compiled with large
> offsets are run on 64-bit kernels
> - add new_inode_autonum which guarantees that i_ino is assigned a unique val
> on the filesystem.
> - Change new_inode to assign i_ino to 0 to catch filesystems that use it and
> don't reset it to a unique value.
I like the general approach. A few tidbits...
- the comment for __new_inode isn't accurate, there is no @autonum
parameter added.
- I'm not sure what the point of wrapping __new_inode() in new_inode()
is. Why not just remove the i_ino setting from new_inode, (or
initialize it to 0*), and let new_inode_autonum() call new_inode();
iunique() ? Less indirection IMHO....
- *does setting the new i_ino to 0 really help catch anything? And if
it does, perhaps just setting it in alloc_inode() with all the other
field initializations would be more consistent.
- the comment for the s_nextino field is a bit misleading, it is
actually not used in new_inode(), only in iunique().
-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/