Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Chris Murphy <lists@colorremedies.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: GRUB writing to grubenv outside of kernel fs code
Date: Tue, 18 Sep 2018 08:24:32 +0300	[thread overview]
Message-ID: <f0f6dfbd-bdb5-eaa7-ba7b-f6f65ceb8e87@gmail.com> (raw)
In-Reply-To: <CAJCQCtTw9=A7BS-eZTy0rRJ1V0+=tUY5c43rvGg5ieY4EkdWZg@mail.gmail.com>

18.09.2018 07:21, Chris Murphy пишет:
> On Mon, Sep 17, 2018 at 9:44 PM, Chris Murphy <lists@colorremedies.com> wrote:
>> https://btrfs.wiki.kernel.org/index.php/FAQ#Does_grub_support_btrfs.3F
>>
>> Does anyone know if this is still a problem on Btrfs if grubenv has
>> xattr +C set? In which case it should be possible to overwrite and
>> there's no csums that are invalidated.
>>
>> I kinda wonder if in 2018 it's specious for, effectively out of tree
>> code, to be making modifications to the file system, outside of the
>> file system.
> 
> a. The bootloader code (pre-boot, not user space setup stuff) would
> have to know how to read xattr and refuse to overwrite a grubenv
> lacking xattr +C.
> b. The bootloader code, would have to have sophisticated enough Btrfs
> knowledge to know if the grubenv has been reflinked or snapshot,
> because even if +C, it may not be valid to overwrite, and COW must
> still happen, and there's no way the code in GRUB can do full blow COW
> and update a bunch of metadata.
> 
> So answering my own question, this isn't workable. And it seems the
> same problem for dm-thin.
> 
> There are a couple of reserve locations in Btrfs at the start and I
> think after the first superblock, for bootloader embedding. Possibly
> one or both of those areas could be used for this so it's outside the
> file system. But other implementations are going to run into this
> problem too.
> 

That's what SUSE grub2 version does - it includes patches to redirect
writes on btrfs to reserved area. I am not sure how it behaves in case
of multi-device btrfs though.

> I'm not sure how else to describe state. If NVRAM is sufficiently wear
> resilient enough to have writes to it possibly every day, for every
> boot, to indicate boot success/fail.
> 

  reply	other threads:[~2018-09-18 10:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  3:44 GRUB writing to grubenv outside of kernel fs code Chris Murphy
2018-09-18  4:21 ` Chris Murphy
2018-09-18  5:24   ` Andrei Borzenkov [this message]
2018-09-18  5:37     ` Chris Murphy
2018-09-18 18:16       ` Andrei Borzenkov
2018-09-18 18:25         ` Austin S. Hemmelgarn
2018-09-18 18:38           ` Andrei Borzenkov
2018-09-18 19:11             ` Austin S. Hemmelgarn
2018-09-19  5:10               ` Andrei Borzenkov
2018-09-18 19:00           ` Chris Murphy
2018-09-18 19:14             ` Austin S. Hemmelgarn
2018-09-18 18:57         ` Chris Murphy
2018-09-18 19:01           ` Andrei Borzenkov
2018-09-18 19:22             ` Chris Murphy
2018-09-18 19:13           ` Austin S. Hemmelgarn
2018-09-18 17:15   ` Goffredo Baroncelli
2018-09-18 18:52     ` Chris Murphy
2018-09-18 19:11       ` Goffredo Baroncelli
2018-09-18 19:34         ` Chris Murphy
2018-09-19  5:03           ` Duncan
2018-09-19 19:08     ` Goffredo Baroncelli
2018-09-19 19:34       ` Austin S. Hemmelgarn
2018-09-18 19:45 ` 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=f0f6dfbd-bdb5-eaa7-ba7b-f6f65ceb8e87@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    /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