public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs: missing endianess conversion in insert_new_root
Date: Wed, 3 Sep 2008 20:18:57 +0200	[thread overview]
Message-ID: <20080903181857.GB17704@lst.de> (raw)

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);

                 reply	other threads:[~2008-09-03 18:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080903181857.GB17704@lst.de \
    --to=hch@lst.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox