ocfs2: Fix a bug found by sparse check.
authorTao Ma <tao.ma@oracle.com>
Wed, 11 Mar 2009 22:24:23 +0000 (06:24 +0800)
committerMark Fasheh <mfasheh@suse.com>
Thu, 12 Mar 2009 23:46:01 +0000 (16:46 -0700)
We need to use le32_to_cpu to test rec->e_cpos in
ocfs2_dinode_insert_check.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Acked-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/alloc.c

index 3a9e5deed74d5ec6900b3b531328ab21fb682a49..19e3a96aa02c00f67b281ea2c3ce0cbd4e0e4b29 100644 (file)
@@ -176,7 +176,8 @@ static int ocfs2_dinode_insert_check(struct inode *inode,
 
        BUG_ON(OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL);
        mlog_bug_on_msg(!ocfs2_sparse_alloc(osb) &&
-                       (OCFS2_I(inode)->ip_clusters != rec->e_cpos),
+                       (OCFS2_I(inode)->ip_clusters !=
+                        le32_to_cpu(rec->e_cpos)),
                        "Device %s, asking for sparse allocation: inode %llu, "
                        "cpos %u, clusters %u\n",
                        osb->dev_str,