linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Josef Bacik <josef@toxicpanda.com>
Cc: Nikolay Borisov <nborisov@suse.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 1/5] btrfs: drop log root for dropped roots
Date: Fri, 13 Dec 2019 16:17:07 +0100	[thread overview]
Message-ID: <20191213151707.GX3929@twin.jikos.cz> (raw)
In-Reply-To: <9392b4c1-4b7e-b5fb-dafe-0a1a45e0d319@toxicpanda.com>

On Tue, Dec 10, 2019 at 04:28:17PM -0500, Josef Bacik wrote:
> >>>> If we fsync on a subvolume and create a log root for that volume, and
> >>>> then later delete that subvolume we'll never clean up its log root.  Fix
> >>>> this by making switch_commit_roots free the log for any dropped roots we
> >>>> encounter.
> >>>> +        btrfs_free_log(trans, root);
> >>>
> >>> THis patch should really have been this line and converting
> >>> switch_commit_roots to taking a trans handle another patch. Otherwise
> >>> this is lost in the mechanical refactoring.
> >>
> >> We need the trans handle to even call btrfs_free_log, we're just fixing
> >> it so the trans handle can be passed in, making its separate is just
> >> superfluous.  Thanks,
> > 
> > Actually no because callees handle the case when trans is not passed
> > (i.e. walk_log_tree and walk_(up|down)_log_tree. If passing valid
> > trances changes the call logic then this needs to be explained in the
> > changelog. And there is currently one caller calling that function
> > without a trans - btrfs_drop_and_free_fs_root in BTRFS_FS_STATE_ERROR case.
> 
> Yeah, it's clear that NULL is used only in the error case.  I'm not going to 
> explain the entirety of how the log tree works in a basic fix for not freeing up 
> a tree log when we should be doing it.  Thanks,

Sure you can at least note that the parameter type needs to be changed,
so we don't have to spend too much time looking for the real fix.

  reply	other threads:[~2019-12-13 20:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 14:37 [PATCH 0/5] Various fixes Josef Bacik
2019-12-06 14:37 ` [PATCH 1/5] btrfs: drop log root for dropped roots Josef Bacik
2019-12-06 15:02   ` Filipe Manana
2019-12-06 15:03   ` Nikolay Borisov
2019-12-09 17:39     ` David Sterba
2019-12-10 20:05     ` Josef Bacik
2019-12-10 21:19       ` Nikolay Borisov
2019-12-10 21:28         ` Josef Bacik
2019-12-13 15:17           ` David Sterba [this message]
2019-12-06 14:37 ` [PATCH 2/5] btrfs: don't BUG_ON in create_subvol Josef Bacik
2019-12-06 15:03   ` Filipe Manana
2019-12-09 10:49   ` Johannes Thumshirn
2019-12-06 14:37 ` [PATCH 3/5] btrfs: handle ENOENT in btrfs_uuid_tree_iterate Josef Bacik
2019-12-06 15:13   ` Filipe Manana
2019-12-06 15:17     ` Josef Bacik
2019-12-06 16:39   ` [PATCH 3/5][v2] " Josef Bacik
2019-12-06 16:46     ` Filipe Manana
2019-12-09 10:52     ` Johannes Thumshirn
2019-12-06 14:37 ` [PATCH 4/5] btrfs: skip log replay on orphaned roots Josef Bacik
2019-12-06 15:23   ` Filipe Manana
2019-12-06 14:37 ` [PATCH 5/5] btrfs: do not leak reloc root if we fail to read the fs root Josef Bacik
2019-12-06 15:24   ` Filipe Manana
2019-12-09 10:58   ` Johannes Thumshirn
2019-12-09 18:16 ` [PATCH 0/5] Various fixes 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=20191213151707.GX3929@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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;
as well as URLs for NNTP newsgroup(s).