Skip to content

Commit

Permalink
Btrfs: missing endianess conversion in insert_new_root
Browse files Browse the repository at this point in the history
Add two missing endianess conversions in this function, found by sparse.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Christoph Hellwig authored and Chris Mason committed Sep 25, 2008
1 parent 50ec891 commit ad3d81b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,8 +1656,8 @@ static int noinline insert_new_root(struct btrfs_trans_handle *trans,

c = btrfs_alloc_free_block(trans, root, root->nodesize,
root->root_key.objectid,
root_gen, lower_key.objectid, level,
root->node->start, 0);
root_gen, le64_to_cpu(lower_key.objectid),
level, root->node->start, 0);
if (IS_ERR(c))
return PTR_ERR(c);

Expand Down Expand Up @@ -2352,8 +2352,9 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,

right = btrfs_alloc_free_block(trans, root, root->leafsize,
root->root_key.objectid,
root_gen, disk_key.objectid, 0,
l->start, 0);
root_gen,
le64_to_cpu(disk_key.objectid),
0, l->start, 0);
if (IS_ERR(right)) {
BUG_ON(1);
return PTR_ERR(right);
Expand Down

0 comments on commit ad3d81b

Please sign in to comment.