Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@inwind.it>
To: Chris Murphy <lists@colorremedies.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: GRUB writing to grubenv outside of kernel fs code
Date: Tue, 18 Sep 2018 21:11:08 +0200	[thread overview]
Message-ID: <5bf40cee-ca21-da82-c522-69766241d735@inwind.it> (raw)
In-Reply-To: <CAJCQCtRsox-QC2xkmpuTynHM6+MjQHCff2bEy3659FNQ5YN1oA@mail.gmail.com>

On 18/09/2018 20.52, Chris Murphy wrote:
> On Tue, Sep 18, 2018 at 11:15 AM, Goffredo Baroncelli
> <kreijack@libero.it> wrote:
>> On 18/09/2018 06.21, Chris Murphy wrote:
>>> 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.
>>
>> And what if GRUB ignore the possibility of COWing and overwrite the data ? Is it a so big problem that the data is changed in all the snapshots ?
>> It would be interested if the same problem happens for a swap file.....
> 
> I think it's an abomination :-) It totally perverts the idea of
> reflinks and snapshots and blurs the line between domains. 

:-)

> Is it a
> user file or not and are these user space commands or not and are they
> reliable or do they have exceptions?

On this statement I fully agree, on the one below a bit less
> 
> I have a boot subvolume mounted at /boot, and this boot subvolume gets
> snapshot, and if GRUB can overwrite grubenv, it overwrites the
> purported GRUB state information in every one of those boots, going
> back maybe months, even when these are read only subvolumes.

Also the 'suse' behavior have the same issue: storing the data somewhere in the storage reserved area suffers of the same problem. We should be realistic, without implement a full btrfs filesystem engine, it is near impossible to have a grubenv file visible by the filesystem and snapshot-able.


> 
> I think it's a problem, and near as I can tell it'll be a problem for
> all kinds of complex storage. I don't see how the bootloader itself
> can do an overwrite onto raid5 or raid6. 


> That's certainly supported by GRUB for reading
Not yet, I am working on that [1]

> but is the bootloader overwrite of gruvenv going to
> recompute parity and write to multiple devices? Eek!

Recompute the parity should not be a big deal. Updating all the (b)trees would be a too complex goal.
> 
> 

[1] http://lists.gnu.org/archive/html/grub-devel/2018-06/msg00064.html
-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2018-09-19  0:53 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
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 [this message]
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=5bf40cee-ca21-da82-c522-69766241d735@inwind.it \
    --to=kreijack@inwind.it \
    --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