[PATCH 11/14] PMFS: Fix two endian bugs in pmfs_init()

Matthew Wilcox matthew.r.wilcox at intel.com
Mon Oct 7 09:37:40 EDT 2013


From: Matthew Wilcox <willy at linux.intel.com>

Assigning a __le32 to a __le64 pointer leads to storing the data in
different places on big and little endian systems.  Use the right
size conversions.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox at intel.com>
---
 fs/pmfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pmfs/super.c b/fs/pmfs/super.c
index 83c0464..4a0fd63 100644
--- a/fs/pmfs/super.c
+++ b/fs/pmfs/super.c
@@ -482,8 +482,8 @@ static struct pmfs_inode *pmfs_init(struct super_block *sb,
 	root_i->i_links_count = cpu_to_le16(2);
 	root_i->i_blk_type = PMFS_BLOCK_TYPE_4K;
 	root_i->i_flags = 0;
-	root_i->i_blocks = cpu_to_le32(1);
-	root_i->i_size = cpu_to_le32(sb->s_blocksize);
+	root_i->i_blocks = cpu_to_le64(1);
+	root_i->i_size = cpu_to_le64(sb->s_blocksize);
 	root_i->i_atime = root_i->i_mtime = root_i->i_ctime =
 		cpu_to_le32(get_seconds());
 	root_i->root = cpu_to_le64(pmfs_get_block_off(sb, blocknr,
-- 
1.8.4.rc3




More information about the Linux-pmfs mailing list