All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gabriel de Perthuis <g2p.code@gmail.com>
To: Hugo Mills <hugo@carfax.org.uk>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>,
	Jerome Haltom <wasabi@cogito.cx>
Subject: Re: Q: Why subvolumes?
Date: Tue, 23 Jul 2013 21:41:47 +0200	[thread overview]
Message-ID: <51EEDC7B.7040101@gmail.com> (raw)
In-Reply-To: <20130723193013.GI20517@carfax.org.uk>

Le mar. 23 juil. 2013 21:30:13 CEST, Hugo Mills a écrit :
> On Tue, Jul 23, 2013 at 07:47:41PM +0200, Gabriel de Perthuis wrote:
>>>    Now... since the snapshot's FS tree is a direct duplicate of the
>>> original FS tree (actually, it's the same tree, but they look like
>>> different things to the outside world), they share everything --
>>> including things like inode numbers. This is OK within a subvolume,
>>> because we have the semantics that subvolumes have their own distinct
>>> inode-number spaces. If we could snapshot arbitrary subsections of the
>>> FS, we'd end up having to fix up inode numbers to ensure that they
>>> were unique -- which can't really be an atomic operation (unless you
>>> want to have the FS locked while the kernel updates the inodes of the
>>> billion files you just snapshotted).
>>
>> I don't think so; I just checked some snapshots and the inos are the same.
>> Btrfs just changes the dev_id of subvolumes (somehow the vfs allows this).
>
>    That's what I said. Our current implementation allows different
> subvolumes to have the same inode numbers, which is what makes it
> work. If you threw out the concept of subvolumes, or allowed snapshots
> within subvolumes, then you'd be duplicating inodes within a
> subvolume, which is one reason it doesn't work.

Sorry for misreading you.
Directory snapshots can work by giving a new device number to the snapshot.
There is no need to update inode numbers in that case.

  reply	other threads:[~2013-07-23 19:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23 11:59 Q: Why subvolumes? Jerome Haltom
2013-07-23 14:52 ` AW: " Andreas Buschka
2013-07-23 15:06 ` Q: " Hugo Mills
2013-07-23 17:47   ` Gabriel de Perthuis
2013-07-23 19:30     ` Hugo Mills
2013-07-23 19:41       ` Gabriel de Perthuis [this message]
2013-07-23 19:43       ` Jerome Haltom
2013-07-23 21:52         ` Chris Murphy
2013-07-23 23:39           ` Jerome Haltom
2013-07-24  1:27             ` Josef Bacik
2013-07-24  2:02               ` Chris Murphy
2013-08-04 14:56         ` Alexandre Oliva

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=51EEDC7B.7040101@gmail.com \
    --to=g2p.code@gmail.com \
    --cc=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wasabi@cogito.cx \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.