From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: Filipe Manana <fdmanana@gmail.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>,
kernel-team@fb.com, Josef Bacik <jbacik@fb.com>
Subject: Re: [PATCH 1/2] btrfs: catch cow on deleting snapshots
Date: Thu, 6 Dec 2018 19:05:35 +0100 [thread overview]
Message-ID: <20181206180534.GD23615@twin.jikos.cz> (raw)
In-Reply-To: <20181130171917.oce3tpl6kjsujpia@macbook-pro-91.local.dhcp.thefacebook.com>
On Fri, Nov 30, 2018 at 12:19:18PM -0500, Josef Bacik wrote:
> On Fri, Nov 30, 2018 at 05:14:54PM +0000, Filipe Manana wrote:
> > On Fri, Nov 30, 2018 at 4:53 PM Josef Bacik <josef@toxicpanda.com> wrote:
> > >
> > > From: Josef Bacik <jbacik@fb.com>
> > >
> > > When debugging some weird extent reference bug I suspected that we were
> > > changing a snapshot while we were deleting it, which could explain my
> > > bug. This was indeed what was happening, and this patch helped me
> > > verify my theory. It is never correct to modify the snapshot once it's
> > > being deleted, so mark the root when we are deleting it and make sure we
> > > complain about it when it happens.
> > >
> > > Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> > > ---
> > > fs/btrfs/ctree.c | 3 +++
> > > fs/btrfs/ctree.h | 1 +
> > > fs/btrfs/extent-tree.c | 9 +++++++++
> > > 3 files changed, 13 insertions(+)
> > >
> > > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> > > index 5912a97b07a6..5f82f86085e8 100644
> > > --- a/fs/btrfs/ctree.c
> > > +++ b/fs/btrfs/ctree.c
> > > @@ -1440,6 +1440,9 @@ noinline int btrfs_cow_block(struct btrfs_trans_handle *trans,
> > > u64 search_start;
> > > int ret;
> > >
> > > + if (test_bit(BTRFS_ROOT_DELETING, &root->state))
> > > + WARN(1, KERN_CRIT "cow'ing blocks on a fs root thats being dropped\n");
> >
> > Please use btrfs_warn(), it makes sure we use a consistent message
> > style, identifies the fs, etc.
> > Also, "thats" should be "that is" or "that's".
> >
>
> Ah yeah, I was following the other convention in there but we should probably
> convert all of those to btrfs_warn. I'll fix the grammer thing as well, just a
> leftover from the much less code of conduct friendly message I originally had
> there. Thanks,
Committed with the following fixup:
- WARN(1, KERN_CRIT "cow'ing blocks on a fs root thats being dropped\n");
+ btrfs_error(fs_info,
+ "COW'ing blocks on a fs root that's being dropped");
next prev parent reply other threads:[~2018-12-06 18:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-30 16:52 [PATCH 0/2] Fix aborts when dropping snapshots Josef Bacik
2018-11-30 16:52 ` [PATCH 1/2] btrfs: catch cow on deleting snapshots Josef Bacik
2018-11-30 17:14 ` Filipe Manana
2018-11-30 17:19 ` Josef Bacik
2018-12-06 18:05 ` David Sterba [this message]
2018-12-01 0:19 ` Qu Wenruo
2018-12-01 3:02 ` Hans van Kranenburg
2018-11-30 16:52 ` [PATCH 2/2] btrfs: run delayed items before dropping the snapshot Josef Bacik
2018-11-30 17:12 ` Filipe Manana
2018-11-30 21:15 ` Filipe Manana
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=20181206180534.GD23615@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@gmail.com \
--cc=jbacik@fb.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--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).