linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Drebes <lists-receive@programmierforen.de>
To: linux-fsdevel@vger.kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>, Tomas M <tomas@slax.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: cramfs in big endian
Date: Sat, 10 Nov 2007 21:26:56 +0100	[thread overview]
Message-ID: <200711102126.57010.lists-receive@programmierforen.de> (raw)
In-Reply-To: <20071110151322.GA21768@infradead.org>

> > Endian-independent code is slower than wrong-endian code, because of the 
> > necessary conditionals.  Thus, you DO NOT WANT this(*).
> 
> I'd prefer not to have it either.  But a someone (pinhead) was smart
> enough not to define an endianess for cramfs from the beginning we're
> stuck with it.

Indeed, this is the problem. The readme file fs/cramfs/README states:

"One part of that is addressing endianness.  The two options here are
`always use little-endian' (like ext2fs) or `writer chooses
endianness; kernel adapts at runtime'.  Little-endian wins because of
code simplicity and little CPU overhead even on big-endian machines."

Unfortunately, the better idea was never implemented. Further, there's no 
information about the endianness stored in the filesystem. Guessing it and 
mounting the filesystem isn't a clean solution. Even worse, there's no 
information about which compression algorithm was used to create the 
filesystem. Guessing the compression method may lead to serious problems.

So here is my proposal for future development of cramfs:
The should tell cramfs how to mount a filesystem. Therefore, the endianness 
and the compression method both have to be specified manually. If none is 
specified, cramfs will assume host endianness and that deflate can be used in 
order to decompress the contents. If something seems to be wrong with the 
filesystem (e.g. wrong magic), cramfs will guess the endianness and inform 
the user about the guess, but it won't mount the filesystem if it doesn't 
match the endianness specified or the host's one.

	Andi

  parent reply	other threads:[~2007-11-10 20:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-06 21:16 cramfs in big endian Andi Drebes
2007-11-07 13:52 ` Tomas M
2007-11-07 20:51   ` Andi Drebes
2007-11-07 22:49     ` Christoph Hellwig
2007-11-08 18:10       ` Andi Drebes
2007-11-10  1:03       ` H. Peter Anvin
2007-11-10 15:13         ` Christoph Hellwig
2007-11-10 20:19           ` H. Peter Anvin
2007-11-10 20:26           ` Andi Drebes [this message]
2007-11-10 20:30             ` H. Peter Anvin
2007-11-11 10:20               ` Andi Drebes

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=200711102126.57010.lists-receive@programmierforen.de \
    --to=lists-receive@programmierforen.de \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tomas@slax.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;
as well as URLs for NNTP newsgroup(s).