Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: fdmanana@kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove unnecessary attempt do drop extent maps after adding inline extent
Date: Mon, 16 Nov 2020 16:29:22 +0100	[thread overview]
Message-ID: <20201116152922.GM6756@twin.jikos.cz> (raw)
In-Reply-To: <1b80a3ffc965dbf663ab746dc11ea5e9fa1e10bf.1605266387.git.fdmanana@suse.com>

On Fri, Nov 13, 2020 at 11:24:17AM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> At inode.c:cow_file_range_inline(), after we insert the inline extent
> in the fs/subvolume btree, we call btrfs_drop_extent_cache() to drop
> all extent maps in the file range, however that is not necessary because
> we have already done it in the call to btrfs_drop_extents(), which calls
> btrfs_drop_extent_cache() for us, and since at this point we have the file
> range locked in the inode's iotree (we are in the writeback path), we know
> no other task can come in and read stale file extent items or find none
> and therefore create either stale extent maps or an extent map that
> represens a hole.
> 
> So just remove that unnecessary call to btrfs_drop_extent_cache(), as it's
> doing nothing and only wasting time. This call has been around since 2008,
> introduced in commit c8b978188c9a ("Btrfs: Add zlib compression support"),
> but even back then it seems it was not necessary, since we had the range
> locked in the inode's iotree and the call to btrfs_drop_extents() already
> used to always call btrfs_drop_extent_cache().
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.

      parent reply	other threads:[~2020-11-16 15:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 11:24 [PATCH] btrfs: remove unnecessary attempt do drop extent maps after adding inline extent fdmanana
2020-11-13 18:09 ` Josef Bacik
2020-11-16 15:29 ` 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=20201116152922.GM6756@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