linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: Goffredo Baroncelli <kreijack@inwind.it>
Cc: Chris Murphy <lists@colorremedies.com>,
	David Sterba <dsterba@suse.cz>,
	Andrei Borzenkov <arvidjaar@gmail.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Does GRUB btrfs support log tree?
Date: Wed, 13 Nov 2019 17:00:20 +0000	[thread overview]
Message-ID: <CAJCQCtQm_5L9uvH53O3Qby3Ktwpvsc2_6rUhkBLGeD07RP5a7Q@mail.gmail.com> (raw)
In-Reply-To: <d2301902-bd5b-7c5a-0354-a5df21ca8eb3@libero.it>

On Tue, Nov 12, 2019 at 8:04 PM Goffredo Baroncelli <kreijack@libero.it> wrote:
>
> On 11/11/2019 20.37, Chris Murphy wrote:
> > Anyway, the lack of a generic (file system independent) way to handle
> > this use case is actually a bit concerning.
>
> I think that a more simpler approach would be developing a GRUB fs, where is the kernel to be adapted to the needing of GRUB...
> So we can lowering the requirement...

I do really agree with this. It seems like a neat idea that a
bootloader can just read any file system, but when it cannot have a
true/complete view of the file system state because it just flat out
ignores critical parts of the file system? Egads.


> The GRUB-fs should have the following main requirements:
> - allow the atomicity guarantee
> - allow molti-disk setup
> - allow grub to update some file (grubenv come me as first)
> - it should require a simple implementation (easy to porting to multiple system, which basically means linux, *bsd and solaris ?)
> - the speed should be not important

Plausibly we're most of the way there already, adapting the existing
"BIOS Boot" partition.

>
>
> Anyway GRUB on BTRFS suffers of a big limitation: GRUB can't update the grubenv file; and until GRUB will learn how update a COW filesystem, this limit will be impossible to avoid (*)

Yep. And I've discussed it with XFS and ext4 devs and they're not keen
on anything writing into file system space outside of their (kernel or
user space repair too) code, which is a reasonable concern. XFS
doesn't have inline extents yet, but it's proposed. ext4 does have
inline extents I think but not enabled by default, and I also think it
takes a non-default inode size to support the ~1KiB typical grubenv
file size: but inline extents would be subject to metadata
checksumming, same as on Btrfs. So in effect, there are valid use
cases that are, or may soon become, invalid for grubenv use as
currently implemented, on the most common Linux file systems.

> (*) Even tough implementing the update of a NOCSUM file should be not so difficult...

So far I've seen 1KiB grubenv is pretty much always an inline extent
on Btrfs. Even if flagged nocow it ends up being subject to leaf
checksum. If GRUB modifies this grubenv, now that whole leaf is
invalid which could mean data loss for things not even related to the
grubenv, depending on what else is in the leaf.

I mean, GRUB is very cool in many ways, but it's so complicated that
maintaining it all I think is a real challenge and concern. And then
on top of that, the various distributions actively fork it into their
own mutually incompatible flavors. It's like GRUB is a set of LEGOs
and everyone can really optionally build their own whatever.

-- 
Chris Murphy

  reply	other threads:[~2019-11-13 17:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  9:47 Does GRUB btrfs support log tree? Chris Murphy
2019-10-25  9:50 ` Chris Murphy
2019-10-26  7:12 ` Andrei Borzenkov
2019-10-27 20:05   ` Chris Murphy
2019-11-04 19:34     ` David Sterba
2019-11-11 19:37       ` Chris Murphy
2019-11-12 20:04         ` Goffredo Baroncelli
2019-11-13 17:00           ` Chris Murphy [this message]
2019-11-13 18:54             ` Goffredo Baroncelli
2019-11-13 21:50               ` Chris Murphy
2019-11-14  8:18                 ` Andrei Borzenkov
2019-11-17 23:24                   ` Chris Murphy

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=CAJCQCtQm_5L9uvH53O3Qby3Ktwpvsc2_6rUhkBLGeD07RP5a7Q@mail.gmail.com \
    --to=lists@colorremedies.com \
    --cc=arvidjaar@gmail.com \
    --cc=dsterba@suse.cz \
    --cc=kreijack@inwind.it \
    --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;
as well as URLs for NNTP newsgroup(s).