Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KEm0s-0005G0-14 for mharc-grub-devel@gnu.org; Fri, 04 Jul 2008 10:11:50 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEm0q-0005Fl-8m for grub-devel@gnu.org; Fri, 04 Jul 2008 10:11:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEm0o-0005FZ-6i for grub-devel@gnu.org; Fri, 04 Jul 2008 10:11:47 -0400 Received: from [199.232.76.173] (port=48662 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEm0o-0005FW-2q for grub-devel@gnu.org; Fri, 04 Jul 2008 10:11:46 -0400 Received: from ti-out-0910.google.com ([209.85.142.188]:46882) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEm0m-0008S6-PU for grub-devel@gnu.org; Fri, 04 Jul 2008 10:11:45 -0400 Received: by ti-out-0910.google.com with SMTP id u5so108203tia.10 for ; Fri, 04 Jul 2008 07:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=mkFAPlEhSXw4U4sQOkAAKXBzWi/A4Nn3BkNq/127MrM=; b=U/qq7f8OgXBdq3D3mEz9Iy4T+2/1aiA/O5ilOtwwvi8jtR3bqk0DbxRFoBdcS2dYTw u9cb0YYczxrqBqeMeG3wF8hAeaY5TUgy0vM+88uZBMdKEFRaTru1Ehb30EnaMJAZyUch q9Ktnz4WRvwuXBd37Tts4ZLbW3zBUuvZtsrKk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xVk5IUePJBXj0dX5UmMKOUSzBtiJewknOZ+sttbo0zHfO8oCIvtVAwJeov9rn8oYXb BFqekcw/PAXUcTcsoUdduDhNs7jrhu4wymqcq3MZRWwIpVnztdsjREgts+nT5Bbscy7S okJd10/UTk/moZjrDAfDFQ3ONwLLX06Pa1I38= Received: by 10.110.7.18 with SMTP id 18mr253395tig.32.1215180702597; Fri, 04 Jul 2008 07:11:42 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Fri, 4 Jul 2008 07:11:42 -0700 (PDT) Message-ID: Date: Fri, 4 Jul 2008 22:11:42 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <1215172834.26019.97.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1215027160.9353.125.camel@localhost> <20080703140211.GA19341@thorin> <1215104875.8123.23.camel@localhost> <20080704000829.GE4074@thorin> <1215135163.26019.44.camel@localhost> <1215167690.26019.78.camel@localhost> <1215172834.26019.97.camel@localhost> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: grub-probe detects ext4 wronly as ext2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2008 14:11:48 -0000 On Fri, Jul 4, 2008 at 8:00 PM, Javier Mart=EDn wrot= e: > El vie, 04-07-2008 a las 19:29 +0800, Bean escribi=F3: >> On Fri, Jul 4, 2008 at 6:34 PM, Javier Mart=EDn w= rote: >> > I know I promised not to keep posting but... I just cannot xD >> > >> > El vie, 04-07-2008 a las 14:49 +0800, Bean escribi=F3: >> >> Hi, >> >> >> >> This is an example of good practice, which check the driver >> >> by function, not by flags. >> > This will find and check core.img. As my previous post showed, one fil= e >> > being readable in a partition with an incompatible flag does not >> > guarantee that every file will be. Thus, the conservative policy for >> > grub-probe would be to also check that the FS is "theoretically" >> > accesible (i.e. the ext2/whatever driver is fine with its flags) in >> > addition to the current "practical" check. >> >> Yes, one file can't guarantee the whole fs is accessible, but it's a >> good indicator. Nothing can guarantee 100% success. Even without >> structure change, grub can still fail if the underlying fs is dirty. >> >> >> >> >> The flags are a little vague, for example, >> >> if they change btree structure in the future, this would introduce >> >> another flag, but we don't need to worry about it, because we don't >> >> use it at all. >> > The btree flag (and any of its modifications) is ROCOMPAT, which indee= d >> > allows us not to worry about it at all, because our driver is read onl= y. >> > The proposed patch addresses only INCOMPAT flags, and it even adds a >> > mechanism to ignore some of them because we deem them not to create re= al >> > incompatibilities (like needs-recovery). >> >> It's just an example. We only use part of ext's structure, there is >> every chance that some part of it has been changed and we're not >> affected. > That's the point of categorizing new features in "rw-compat", > "ro-compat" and "incompat". The first two indicate changes that won't > affect any reader, while the latter warn readers that they will very > probably find incompatible metadata which they will not be able to > interpret. From the _current_ list of incompatible features: > compression, filetype, needs_recovery, journal_dev, meta_bg, extents, > 64bit and flex_bg; we have implemented support for one (filetype) and > knowingly ignore another (needs_recovery). However, every other incompat > flag affects the metadata format in ways that cause strange failures > difficult for the user to trace, like the Godfather tune in my other > post being read as 256 bytes of zeros. > > As an example, one of the _bg flags (meta_bg iIrc) means that inodes may > be lazily written to disk instead of every single one being initialized > by mke2fs, which speeds up the format process a lot. Given that our > driver does not know what to do with that "incompat" feature (and it > currently ignores it), if our driver met one of the inodes not yet > inited, we would read either "garbage" or even worse, metadata from > another extN filesystem that was there before the last mke2fs. > >> >> >> >> >> If we can ensure the boot partition can be accessed, then the problem >> >> is solved. Yes, there may be other partition using ext4 that we can't >> >> access, but remember that linux loader will check for signatures as >> >> well, a corrupted kernel would not be loaded. So the difference is >> >> merely the error message users sees, unknown filesystem or invalid >> >> kernel. >> > I didn't know the "linux" loader checked signatures. Do the "multiboot= ", >> > "multiboot2" and "bsd" loaders do the same? In the platforms where it = is >> > able to load a file, does the "chainloader" loader perform any checks? >> > So in that cases difference would be between "unknown filesystem" and >> > "the FSM knows what". >> > >> >> Yes, they all check for signatures. In fact, commands that deal with >> input file should always check for it first. If not, we need to fix >> that command. > They all check for _certain_ signatures in particular places, like > "multiboot" looking for the MB-info block and chainloader looking for > 0x55aa (in i386-pc), but I already explained how a hypothetical new > incompatible feature like partial compression can make that system go > down the sink, because the block with the signature can well be fine but > other parts be read wrong. > >> >> >> >> >> And, grub WILL follow the evolution the extN, because it's the primar= y >> >> boot loader for linux. The only reason we don't have ext4 support at >> >> present is because it's not stable. If major distro starts to use it >> >> as default, we would have to support it as well. >> > Please... ReiserFS was used for long in many distros and GRUB2 didn't >> > support it until 1.96 - even with GRUB Legacy having implemented it lo= ng >> > ago. I literally waited years for it to be included! Besides, as I >> > already said, we cannot win in a race against the future: new features= , >> > some of them incompatible, are introduced ""constantly"" (every few >> > years) in extN, and until we get to know about them and at least decid= e >> > whether they can be safely ignored, the sane behavior is to obey them >> > and reject access (except if the user override is enabled). Yes, we ca= n >> > implement ext4 and possibly even before it's released as stable, but >> > could you please start implementing ext7 so that we don't have to worr= y >> > about its incompatibilities when it comes? >> >> It's an ongoing process for grub. Besides, compatibility goes both >> ways. The developer of extN file system would also consider existing >> driver, significant change to the fs structure would not be as >> frequent. >> > In the nearly eight years from ext2 release to the merge of ext3 into > the kernel, some incompatible features were introduced in ext2 proper, > like filetype and compression. Even now, with ext4 in development and > merged into the kernel less than five years after ext3, incompatible > features are being backported to ext2 like the lazy inode initializing I > mentioned earlier. Those can hit us HARD. Hi, Actually, I don't see the point of this discussion. The worst case scenario is hanging grub, instead of report a unknown file system error. The end result the same, user can't boot from this partition. The point here is that we should try our best to read from it. If it's indeed incompatible, there is nothing we can do. About the flags, no one can guarantee that the incompat bit would result in an unreadable fs. The journal is a good example. Even with journal enabled, we can read from it most of the time. Note that the /boot directory is rarely touched, and we sync twice when modifying it. You may argue that there is still a chance of failure. Well, there certainly is, but should we disable install to ext3 ? --=20 Bean