From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: cramfs in big endian Date: Sat, 10 Nov 2007 12:30:32 -0800 Message-ID: <473614E8.2010802@zytor.com> References: <200711062216.27156.lists-receive@programmierforen.de> <47350345.4010108@zytor.com> <20071110151322.GA21768@infradead.org> <200711102126.57010.lists-receive@programmierforen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Tomas M , Christoph Hellwig To: Andi Drebes Return-path: Received: from terminus.zytor.com ([198.137.202.10]:47405 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbXKJUdy (ORCPT ); Sat, 10 Nov 2007 15:33:54 -0500 In-Reply-To: <200711102126.57010.lists-receive@programmierforen.de> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Andi Drebes wrote: > > 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. > What about simply deep-sixing cramfs and replacing it with squashfs or something else? -hpa