Skip to content

Commit

Permalink
ocfs2: Fix an endian bug in online resize.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Mar 10, 2008
1 parent 90d9977 commit 4338ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4338ab6

Please sign in to comment.