linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@gmail.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] BTRFS-PROG: recursively subvolume snapshot and delete
Date: Thu, 28 Nov 2013 20:23:13 +0100	[thread overview]
Message-ID: <52979821.60401@gmail.com> (raw)
In-Reply-To: <20131128183122.GL25312@twin.jikos.cz>

Hi David,
On 2013-11-28 19:31, David Sterba wrote:
> On Sat, Nov 16, 2013 at 06:09:00PM +0100, Goffredo Baroncelli wrote:
>> the following patches implement the recursively snapshotting and
>> deleting of a subvolume. 
> 
> Nice feature, but can we try to make the snapshot creation atomic? This
> would need support from kernel of course.
> 
> I'm worried about the outcome from the users' perspective, the
> consistency of the whole subvolume subtree. As you've implemented it,
> there are several operations involved like traversing the subvolume
> list, replacing the empty-subvols with the real ones, taking the
> snapshots. The assumptions about existing source subvolumes may change
> in the meantime: renamed or deleted.

Definetely you are right. In fact this is true also for other tools like
tar: they complaint if you remove/move/rename a file during the copy. We
can work to increase the robustness of the process, to avoid strange
behaviour when a subvolume is removed/moved/renamed.

Anyway I am more afraid that we can't mix recursive and readonly snapshot.

Implementing the atomic recursive snapshot in the kernel, is out of my
possibility; anyway basically this means that the filesystem is frozen
until all the snapshot are done, which requires a finite time. In case
of a high number of subvolumes this could be a problem.

May be that it could be more simple to snapshot "all the filesystem", ie
snapshot not from the filesystem-tree but form the root-of-tree; then we
could cherry-pick the subvolume which are involved....

Another possibility is to forzen all subvolumes, then snapshot them,
then unfrozen all the subvolume...

> 
> The recursive deletion is safer form this point, I'll look at the
> patches closer. Deleting the whole directory subtree with randomly
> scattered subvolumes is not easy atm, I'm using wrappers around find and
> maxdepth/mindepth to look for subvols and issue delete until it's done.

The patches should be independent. Otherwise if you think that changing
the order it would be more simple to merge them (even without the
recursive-non-atomic-snapshot), let me know.

> 
> 
> david
> 


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2013-11-28 19:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-16 17:09 [PATCH] BTRFS-PROG: recursively subvolume snapshot and delete Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 1/7] Recursive btrfs sub snapshot/delete: create get_root_info() function Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 2/7] recursive btrfs sub snapshot/delete: create pathjoin() function Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 3/7] recursive btrfs snapshot/delete: create traverse_list_subvol_rec() Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 4/7] recursive btrfs subvol delete Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 5/7] recursively btrfs subvolume snapshot Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 6/7] btrfs subvolume snapshot -R: update man page Goffredo Baroncelli
2013-11-16 17:09 ` [PATCH 7/7] Document the -R switch for the "btrfs subvolume delete" command Goffredo Baroncelli
2013-11-25 21:23 ` [PATCH] BTRFS-PROG: recursively subvolume snapshot and delete Goffredo Baroncelli
2013-11-26 15:12   ` Konstantinos Skarlatos
2013-11-26 17:44     ` Goffredo Baroncelli
2013-11-27  9:15       ` Konstantinos Skarlatos
2013-11-27 17:04         ` Goffredo Baroncelli
2013-11-28 18:31 ` David Sterba
2013-11-28 19:23   ` Goffredo Baroncelli [this message]
2013-11-29 18:07     ` David Sterba
2013-11-29 19:09       ` Goffredo Baroncelli

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=52979821.60401@gmail.com \
    --to=kreijack@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).