Skip to contentSkip to conversation

OCFS2: 64-bit inode number for getattr() instead of 32-bit value

PATCH New wengang wang 2 participants 2 messages Mar 27, 2009 – Mar 29, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OCFS2: 64-bit inode number for getattr() instead of 32-bit value

ocfs2_getattr() uses generic_fillattr() to set inode number(and other attributes). generic_fillattr() inturn fills inode number with inode->i_ino which is a 32-bit(unsigned long) value.

if the ocfs2 partition is huge enough, that may become an incorrect value.
the fix is filling it again after generic_fillattr() with ip_blkno(u64).

--

fs/ocfs2/file.c +2 -0
index a5887df..ffe7d34 100644
@@ -1076,6 +1076,8 @@ int ocfs2_getattr(struct vfsmount *mnt,
 	/* We set the blksize from the cluster size for performance */
 	stat->blksize = osb->s_clustersize;
 
+	stat->ino = OCFS2_I(inode)->ip_blkno;
+
 bail:
 	mlog_exit(err);
 
#1 lore raw

PATCH 1/1 OCFS2: 64-bit inode number for getattr() instead of 32-bit value

Last I checked one could not have 64 bit inode numbers on 32 bit systems. Meaning this patch is not required.

Quoted 30 lines · wengang wang

ocfs2_getattr() uses generic_fillattr() to set inode number(and other attributes). generic_fillattr() inturn fills inode number with inode-

Quoted 1 line

i_ino

which is a 32-bit(unsigned long) value.

if the ocfs2 partition is huge enough, that may become an incorrect value.
the fix is filling it again after generic_fillattr() with ip_blkno(u64).

--

fs/ocfs2/file.c +2 -0
index a5887df..ffe7d34 100644
@@ -1076,6 +1076,8 @@ int ocfs2_getattr(struct vfsmount *mnt,
   /* We set the blksize from the cluster size for performance */
   stat->blksize = osb->s_clustersize;
 
+    stat->ino = OCFS2_I(inode)->ip_blkno;
+

bail:

   mlog_exit(err);

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel