linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcos Paulo de Souza <mpdesouza@suse.de>
To: Graham Cobb <g.btrfs@cobb.uk.net>,
	Marcos Paulo de Souza <marcos.souza.org@gmail.com>,
	linux-kernel@vger.kernel.org
Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
	linux-btrfs@vger.kernel.org, mpdesouza@suse.com
Subject: Re: [PATCH 5/5] btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion
Date: Fri, 25 Oct 2019 12:44:20 -0300	[thread overview]
Message-ID: <06601cbe64c98b2a9f0fa13a4e00401ae5d4387b.camel@suse.de> (raw)
In-Reply-To: <dcfbad52-6e5b-a9cc-e1a7-6b3db8e26e7c@cobb.uk.net>

On Fri, 2019-10-25 at 13:00 +0100, Graham Cobb wrote:
> On 24/10/2019 03:36, Marcos Paulo de Souza wrote:
> > From: Marcos Paulo de Souza <mpdesouza@suse.com>
> > 
> > Since the function btrfs_ioctl_snap_destroy is used for deleting
> both
> > subvolumes and snapshots it was needed call btrfs_is_snapshot,
> > which checks a giver btrfs_root and returns true if it's a
> snapshot.
> > The current code is interested in subvolumes only.
> 
> To me, as a user, a snapshot *is* a subvolume. I don't even know what
> "is a snapshot" means. Does it mean "was created using the btrfs
> subvolume snapshot command"? Does it matter whether the snapshot has
> been modified? Whether the originally snapshot subvolume still
> exists?
> Or what?
> 
> I note that the man page for "btrfs subvolume" says "A snapshot is a
> subvolume like any other, with given initial content.". And I
> certainly
> have some subvolumes which are being used as normal parts of the
> filesystem, which were originally created as snapshots (for various
> reasons, including reverting changes and going back to an earlier
> snapshot, or an easy way to make sure that large common files are
> actually sharing blocks).

Agreed.

> 
> I would expect this event would be generated for any subvolume
> deletion.
> If it is useful to distinguish subvolumes originally created as
> snapshots in some way then export another flag (named to make it
> clear
> what it really indicates, such as BTRFS_VOL_FROM_SNAPSHOT). I don't
> know
> your particular purpose, but my guess is that a more useful flag
> might
> actually be BTRFS_VOL_FROM_READONLY_SNAPSHOT.

As soon as these patches got merged I will send new ones to take care
of snapshoting. Same things: when a snapsoht is created or removed,
send a uevent.

I liked this idea to separate both snapshots and volumes at first to
make things simpler, and get reviews faster. Also, I think it's good to
separate subvolumes and snapshot events, makes easier for one to filter
such events.

  Marcos

> 
> Graham


  reply	other threads:[~2019-10-25 15:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24  2:36 [PATCH 0/5] btrfs: send uevent on subvolume add/remove Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 1/5] btrfs: sysfs: Add envp argument to btrfs_kobject_uevent Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 2/5] btrfs: ioctl: Introduce btrfs_vol_uevent Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 3/5] btrfs: ioctl: Call btrfs_vol_uevent on subvol creation Marcos Paulo de Souza
2019-10-24  2:36 ` [PATCH 4/5] btrfs: ctree.h: Add btrfs_is_snapshot function Marcos Paulo de Souza
2019-10-25 10:02   ` Filipe Manana
2019-10-24  2:36 ` [PATCH 5/5] btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion Marcos Paulo de Souza
2019-10-25 12:00   ` Graham Cobb
2019-10-25 15:44     ` Marcos Paulo de Souza [this message]
2019-11-18 20:50 ` [PATCH 0/5] btrfs: send uevent on subvolume add/remove David Sterba

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=06601cbe64c98b2a9f0fa13a4e00401ae5d4387b.camel@suse.de \
    --to=mpdesouza@suse.de \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=g.btrfs@cobb.uk.net \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcos.souza.org@gmail.com \
    --cc=mpdesouza@suse.com \
    --subject='Re: [PATCH 5/5] btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion' \
    /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

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).