[PATCH 09/14] PMFS: Fix endian bug in pmfs_rmdir()

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

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

Use cpu_to_le32() instead of cpu_to_le64() for i_ctime.  PMFS only
stores 32 bits in the media inode, and the way the code was written,
it would store the upper 32 bits on a big-endian system, not the lower
32 bits as a little-endian system would.

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

diff --git a/fs/pmfs/namei.c b/fs/pmfs/namei.c
index 3e065aa..5243c92 100644
--- a/fs/pmfs/namei.c
+++ b/fs/pmfs/namei.c
@@ -640,7 +640,7 @@ static int pmfs_rmdir(struct inode *dir, struct dentry *dentry)
 	pmfs_memunlock_inode(sb, pi);
 	pi->i_links_count = cpu_to_le16(inode->i_nlink);
-	pi->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec);
+	pi->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec);
 	pmfs_memlock_inode(sb, pi);
 	/* add the inode to truncate list in case a crash happens before the

More information about the Linux-pmfs mailing list