ocfs2: Fix an endian bug in online resize.
authorTao Ma <tao.ma@oracle.com>
Mon, 3 Mar 2008 02:53:02 +0000 (10:53 +0800)
committerMark Fasheh <mark.fasheh@oracle.com>
Mon, 10 Mar 2008 22:14:07 +0000 (15:14 -0700)
In ocfs2_group_add, 'cr' is a disk field of type 'ocfs2_chain_rec', and we
were putting cpu byteorder values into it. Swap things to the right endian
before storing.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/resize.c

index 37835ffcb03985f7bd61a1322538d96ca8f8830d..8166968e9015d8634f1987cd8af84f07595c86b9 100644 (file)
@@ -597,7 +597,7 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input)
                memset(cr, 0, sizeof(struct ocfs2_chain_rec));
        }
 
-       cr->c_blkno = le64_to_cpu(input->group);
+       cr->c_blkno = cpu_to_le64(input->group);
        le32_add_cpu(&cr->c_total, input->clusters * cl_bpc);
        le32_add_cpu(&cr->c_free, input->frees * cl_bpc);