From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/2] Btrfs: simplify error handling of clean_pinned_extents()
Date: Fri, 17 Apr 2020 17:23:10 +0200 [thread overview]
Message-ID: <20200417152310.GR5920@twin.jikos.cz> (raw)
In-Reply-To: <20200417144021.9319-1-fdmanana@kernel.org>
On Fri, Apr 17, 2020 at 03:40:21PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> At clean_pinned_extents(), whether we end up returning success or failure,
> we pretty much have to do the same things:
>
> 1) unlock unused_bg_unpin_mutex
> 2) decrement reference count on the previous transaction
>
> We also call btrfs_dec_block_group_ro() in case of failure, but that is
> better done in its caller, btrfs_delete_unused_bgs(), since its the
> caller that calls inc_block_group_ro(), so it should be responsible for
> the decrement operation, as it is in case any of the other functions it
> calls fail.
>
> So move the call to btrfs_dec_block_group_ro() from clean_pinned_extents()
> into btrfs_delete_unused_bgs() and unify the error and success return
> paths for clean_pinned_extents(), reducing duplicated code and making it
> simpler.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
Added to misc-next, thanks.
next prev parent reply other threads:[~2020-04-17 15:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 14:40 [PATCH 2/2] Btrfs: simplify error handling of clean_pinned_extents() fdmanana
2020-04-17 15:23 ` David Sterba [this message]
2020-04-17 15:25 ` Nikolay Borisov
2020-04-17 15:36 ` [PATCH v2 " fdmanana
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=20200417152310.GR5920@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@kernel.org \
--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