public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Graham Cobb <g.btrfs@cobb.uk.net>
Cc: dsterba@suse.cz, Boris Burkov <boris@bur.io>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Omar Sandoval <osandov@osandov.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] btrfs: detect nocow for swap after snapshot delete
Date: Wed, 19 Aug 2020 16:25:48 +0200	[thread overview]
Message-ID: <20200819142548.GN2026@twin.jikos.cz> (raw)
In-Reply-To: <563ca3a3-d07c-cf1f-cb0f-f41f50f8d516@cobb.uk.net>

On Wed, Aug 19, 2020 at 12:59:28PM +0100, Graham Cobb wrote:
> On 19/08/2020 12:29, David Sterba wrote:
> > How often could the snapshot deletion and swapfile activation happen at
> > the same time? Snapshotting subvolume with the swapfile requires
> > deactivation, snapshot/send/whatever and then activation. This sounds
> > like a realistic usecase.
> 
> It is very likely when the swapfile is one that is only used
> occasionally (for example, when running a particular program which needs
> a massive amount of virtual memory, or having to stop using a different
> swapfile because a disk looks like it is starting to fail).
> 
> If the swapfile is not normally used, it is not unlikely it got
> snapshotted (as part of a larger operation, presumably) while
> deactivated. When the user tries to use it, they realise it isn't
> working because it is snapshotted, so they delete the snapshot and then
> immediately try to activate it again -- causing confusion when it still
> fails.

That makes sense from user POV. I still don't uderstand if it's
sufficient to commit the transaction deleting the snapshot or if it's
necessary to wait until the subvolume is completely cleaned.

The former would require 'btrfs subvol delte -c /snapshot' while the
latter needs the id of the subvolume and then
'btrfs subvol sync /path id'.

  reply	other threads:[~2020-08-19 14:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 18:00 [PATCH] btrfs: detect nocow for swap after snapshot delete Boris Burkov
2020-08-19 11:29 ` David Sterba
2020-08-19 11:59   ` Graham Cobb
2020-08-19 14:25     ` David Sterba [this message]
2020-08-19 17:46       ` Boris Burkov
2020-08-20 16:13         ` 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=20200819142548.GN2026@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=boris@bur.io \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=g.btrfs@cobb.uk.net \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=osandov@osandov.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