public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Boris Burkov <boris@bur.io>
Cc: dsterba@suse.cz, Graham Cobb <g.btrfs@cobb.uk.net>,
	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: Thu, 20 Aug 2020 18:13:04 +0200	[thread overview]
Message-ID: <20200820161304.GA2026@twin.jikos.cz> (raw)
In-Reply-To: <20200819174609.GA1218106@devvm842.ftw2.facebook.com>

On Wed, Aug 19, 2020 at 10:46:09AM -0700, Boris Burkov wrote:
> My reproduction has been:
> create subvol
> create swapfile in subvol
> btrfs subvol snapshot subvol snapshot
> btrfs subvol delete snapshot
> sync/btrfs fi sync/waiting
> swapon subvol/swapfile
> 
> Note that I haven't been touching the swapfile in any way after
> initially creating it. Nor have I been turning swap on/off in any
> coordinated way before/after the snapshot except to test after the
> snapshot is deleted.

Ok, so this is the minimal testcase.

> I tried both suggestions with and without the patch and saw that with
> the patch, swapon reliably succeeds after 'btrfs subvol sync' and does
> not reliably succeed even after 'btrfs subvol delete -c' or sync calls,
> so it seems that we need the subvolume to be completely cleaned. Without
> the patch, after both 'btrfs subvol delete -c' and after 'btrfs subvol
> sync', the swapon fails.

The patch is fine as is so I'll add it to misc-next and tag for stable.
The remaining part is to document in manual page what to do in case the
snapshot was accidentaly created and needs to be deleted.

      reply	other threads:[~2020-08-20 16:14 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
2020-08-19 17:46       ` Boris Burkov
2020-08-20 16:13         ` David Sterba [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=20200820161304.GA2026@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