linux-um archives
 help / color / mirror / Atom feed
From: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: Jeff Dike <jdike@addtoit.com>,
	linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH 4/6] uml: restore include breakage, breaking binary format of COW driver
Date: Sun, 09 Oct 2005 21:37:35 +0200	[thread overview]
Message-ID: <20051009193734.26019.44043.stgit@zion.home.lan> (raw)
In-Reply-To: <200510092118.21032.blaisorblade@yahoo.it>

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

Commit 44456d37b59d8e541936ed26d8b6e08d27e88ac1, between 2.6.13-rc3 and -rc4,
was a "nice cleanup" which broke something. Revert the offending part.

It broke because:
a) because this part doesn't fall under the description
b) the author didn't know what he was doing here
c) the author didn't try to compile the existing code and see that it worked
   perfectly.
d) the author didn't ask us what was happening
e) you didn't either, and somebody there should have learned that UML is a bit
   different.

In fact, UML is special in linking to host libc and using its includes.

In particular, since host includes always define both __BIG_ENDIAN and
__LITTLE_ENDIAN, ntohll() macros started thinking to be in a big-endian world;
and on-disk compatibility was broken.

Many thanks go to Nix for reporting the problem and correctly diagnosing an
endianness problem.

Btw, this patch restores the previous code, which worked; but the definitions
would be uncorrect if used in kernelspace files.

Next patch addresses that.

Cc: Nix <nix@esperi.org.uk>, Olaf Hering <olh@suse.de>
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 arch/um/drivers/cow.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/cow.h b/arch/um/drivers/cow.h
--- a/arch/um/drivers/cow.h
+++ b/arch/um/drivers/cow.h
@@ -3,10 +3,10 @@
 
 #include <asm/types.h>
 
-#if defined(__BIG_ENDIAN)
+#if __BYTE_ORDER == __BIG_ENDIAN
 # define ntohll(x) (x)
 # define htonll(x) (x)
-#elif defined(__LITTLE_ENDIAN)
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
 # define ntohll(x)  bswap_64(x)
 # define htonll(x)  bswap_64(x)
 #else



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  parent reply	other threads:[~2005-10-09 19:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-09 19:18 [uml-devel] Uml left showstopper bugs for 2.6.14 Blaisorblade
2005-10-09 19:37 ` [uml-devel] [PATCH 1/6] Uml: hide commands when not being verbose Paolo 'Blaisorblade' Giarrusso
2005-10-09 19:37 ` [uml-devel] [PATCH 2/6] uml: add mode=skas0 as a synonym of skas0 Paolo 'Blaisorblade' Giarrusso
2005-10-09 19:37 ` [uml-devel] [PATCH 3/6] uml: allow building .s/.i/.lst files from userspace files Paolo 'Blaisorblade' Giarrusso
2005-10-09 19:37 ` Paolo 'Blaisorblade' Giarrusso [this message]
2005-10-09 19:37 ` [uml-devel] [PATCH 5/6] uml: cleanup byte order macros for COW driver Paolo 'Blaisorblade' Giarrusso
2005-10-09 19:37 ` [uml-devel] [PATCH 6/6] uml: cleanup whitespace " Paolo 'Blaisorblade' Giarrusso
2005-10-09 19:42 ` [uml-devel] Uml left showstopper bugs for 2.6.14 Blaisorblade
2005-11-02 21:44   ` Kai Tan
2005-11-02 22:47     ` Blaisorblade
2005-10-09 22:41 ` [uml-devel] " Jeff Dike

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=20051009193734.26019.44043.stgit@zion.home.lan \
    --to=blaisorblade@yahoo.it \
    --cc=akpm@osdl.org \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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