public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: missing endianess conversion in insert_new_root
@ 2008-09-03 18:18 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2008-09-03 18:18 UTC (permalink / raw)
  To: linux-btrfs

Add two missing endianess conversions in this function, found by sparse.

(Btw, there are a _lot_ more endianess warnings, but they're old hidden
 in the obsfucated macros from hell mess.  I'll try to detangle and fix
 it when I get some time)

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: btrfs-unstable/ctree.c
===================================================================
--- btrfs-unstable.orig/ctree.c	2008-08-31 15:40:46.000000000 -0300
+++ btrfs-unstable/ctree.c	2008-08-31 15:41:44.000000000 -0300
@@ -1653,8 +1653,8 @@ static int noinline insert_new_root(stru
 
 	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);
 
@@ -2345,8 +2345,9 @@ again:
 
 	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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-03 18:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03 18:18 [PATCH] btrfs: missing endianess conversion in insert_new_root Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox