linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: reproducible builds with btrfs seed feature
Date: Fri, 19 Oct 2018 08:47:51 +0800	[thread overview]
Message-ID: <d4363456-241d-8631-df21-8a6fe8af72b1@oracle.com> (raw)
In-Reply-To: <CAJCQCtTu0pjAY8k3L=YK0CCv7MvDepUBafMDqf1mBvJbNdFnkg@mail.gmail.com>



On 10/19/2018 02:02 AM, Chris Murphy wrote:
> On Tue, Oct 16, 2018 at 10:08 PM, Anand Jain <anand.jain@oracle.com> wrote:
> 
> 
>>
>>   So a possible solution for the reproducible builds:
>>     usual mkfs.btrfs dev
>>     Write the data
>>     unmount; create btrfs-image with uuid/fsid/time sanitized; mark it as a
>> seed (RO).
>>     check/verify the hash of the image.
> 
> Gotcha. Generation/transid needs to be included in that list. Imagine
> a fast system vs a slow system. The slow system certainly will end up
> with with higher transid's for the latest completed transactions.

  In a scripted build environment the transid could remain same, as 
there won't extra sync or mount -o transid changes.. etc.

> But also, I don't know how the kernel code chooses block numbers,
> either physical (chunk allocation) or logical (extent allocation) and
> if that could be made deterministic. Same for inode assignment.

  The above list may not be complete. To avoid the disk size,type 
related changes one can choose to create a mkfs on a file instead of 
disk. But the point I am trying to make with bytenr is if a tool uses 
certain items which are not explicitly EXPORTED/ioctl, that means it can 
change without notice, unless these tools are inline with the btrfs 
kernel changes it would break.

> Another question that comes up later when creating the sprout by
> removing the seed device, is how a script can know when all block
> groups have successfully copied from seed to sprout, and that the
> sprout can be unmounted.

  Oh.
    mount -o loop seed.img /seed  <-- this will be RO
    btrfs device add /dev/sprout /seed <-- new FSID on the same mount 
point, /dev/sprout will have new SB with new FSID, and sprout device 
count will include the seed device. And originally this was RW already 
but we broke it somewhere. But not a big deal as we can use remount.
    mount -o remount,rw /dev/sprout /seed <-- this is RW. Only _new_ 
writes goes to /dev/sprout, and sprout still needs seed to mount.
    btrfs device delete <seed-devid> /seed <-- this will transfer all 
seed blocks to /dev/sprout.

    Now /dev/sprout is an independent RW FS with the contents from the 
seed and its total device count is now 1.

Thanks, Anand
> 
> 
> 

      reply	other threads:[~2018-10-19  0:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13 22:28 reproducible builds with btrfs seed feature Chris Murphy
2018-10-13 23:05 ` Chris Murphy
2018-10-14 12:20   ` Cerem Cem ASLAN
2018-10-14 18:10     ` Chris Murphy
2018-10-14 19:09       ` Cerem Cem ASLAN
2018-10-14 23:38         ` Chris Murphy
2018-10-15 12:29 ` Austin S. Hemmelgarn
2018-10-15 19:52   ` Chris Murphy
2018-10-16  8:13 ` Anand Jain
2018-10-16 19:49   ` Chris Murphy
2018-10-17  4:08     ` Anand Jain
2018-10-18 18:02       ` Chris Murphy
2018-10-19  0:47         ` Anand Jain [this message]

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=d4363456-241d-8631-df21-8a6fe8af72b1@oracle.com \
    --to=anand.jain@oracle.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;
as well as URLs for NNTP newsgroup(s).