ocfs2: Pass raw u64 to filldir
PATCH 5/15 ocfs2: Pass raw u64 to filldir
filldir_t can take this, so don't turn de->inode into a 32 bit value. Right now this doesn't make a difference since no ocfs2 inodes overflow that, but it could be a nasty surprise later on if some kernel code is calling ocfs2_dir_foreach_blk() and expecting real inode numbers back...
--- fs/ocfs2/dir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ocfs2/dir.c +1 -1
@@ -512,7 +512,7 @@ revalidate: error =filldir (priv, de->name, de->name_len, *f_pos, -ino_from_blkno (sb,le64_to_cpu (de->inode)), +le64_to_cpu (de->inode), d_type);if (error)break ;
Signature · 1 line
1.5.0.6
PATCH 5/15 ocfs2: Pass raw u64 to filldir
Quoted 4 lines · Mark Fasheh
filldir_tcan take this, so don't turnde->inodeinto a 32 bit value. Right now this doesn't make a difference since no ocfs2 inodes overflow that, but it could be a nasty surprise later on if some kernel code is callingocfs2_dir_foreach_blk()and expecting real inode numbers back...
How come we don't have inodes overflowing 32bits? Is this a
limit imposed elsewhere? Refresh my (swiss cheese) memory :-)
I actually think that the -EOVERFLOW from filldir(7) is better
than our truncated ino, so I still say
Signature · 9 lines
Viro's Razor: Any race condition, no matter how unlikely, will occur just often enough to bite you. Joel Becker Principal Software Developer Oracle E-mail: [email protected] Phone: (650) 506-8127
PATCH 5/15 ocfs2: Pass raw u64 to filldir
Quoted 8 lines · Joel Becker
Quoted 4 lines · Mark Fasheh
filldir_tcan take this, so don't turnde->inodeinto a 32 bit value. Right now this doesn't make a difference since no ocfs2 inodes overflow that, but it could be a nasty surprise later on if some kernel code is callingocfs2_dir_foreach_blk()and expecting real inode numbers back...How come we don't have inodes overflowing 32bits? Is this a
limit imposed elsewhere? Refresh my (swiss cheese) memory :-)
Sure - basically since JBD (version 1) doesn't allow for larger than 32 bits worth of blocks, mkfs.ocfs2 prevents such a file system from being created and hence there's no way that we can overflow 32 bits with i_ino today.
Last I checked, JBD2 has Zach's patches to understand 64 bit block numbers.
Once we move over to that, we're going to have to figure out what to do and it's at that point where I figure we'll have to revisit this anyway. It seems that we might have to just always restrict inode blocks to 32 bits anyway because of abi issues beyond our control, but that's a conversation for another day :)
Quoted 2 lines
I actually think that the
-EOVERFLOWfrom filldir(7) is better
than our truncated ino, so I still say
Yeah, agreed. I'd rather get an obvious error and be force to fix it at the source than silently return bad information.
--Mark
--
Mark Fasheh
Senior Software Developer, Oracle
[email protected]