linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Filipe Manana <fdmanana@kernel.org>
To: dsterba@suse.cz, Filipe Manana <fdmanana@kernel.org>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Josef Bacik <josef@toxicpanda.com>
Subject: Re: [PATCH v3 0/4] Btrfs: make ranged fsyncs always respect the given range
Date: Fri, 13 Mar 2020 11:01:35 +0000	[thread overview]
Message-ID: <CAL3q7H42gkjx83Eqd1sfvtqOcj0k4BjLLr-k-C=mA2COcw1dEA@mail.gmail.com> (raw)
In-Reply-To: <20200312203324.GI12659@twin.jikos.cz>

On Thu, Mar 12, 2020 at 8:33 PM David Sterba <dsterba@suse.cz> wrote:
>
> On Mon, Mar 09, 2020 at 12:41:04PM +0000, fdmanana@kernel.org wrote:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > This patchset fixes a bug when not using NO_HOLES and makes ranged fsyncs
> > respect the given file range when using the NO_HOLES feature.
> >
> > The bug is about missing file extents items representing a hole after doing
> > a ranged fsync on a file and replaying the log.
> >
> > Btrfs doesn't respect the given range for a fsync when the inode's has the
> > "need full sync" bit set - it treats the fsync as a full ranged one, operating
> > on the whole file, doing more IO and cpu work then needed.
> >
> > That behaviour was needed to fix a corruption bug. Commit 0c713cbab6200b
> > ("Btrfs: fix race between ranged fsync and writeback of adjacent ranges")
> > fixed that bug by turning the ranged fsync into a full ranged one.
> >
> > Later the hole detection code of fsync was simplified a lot in order to
> > fix another bug when using the NO_HOLES feature - done by commit
> > 0e56315ca147b3 ("Btrfs: fix missing hole after hole punching and fsync when
> > using NO_HOLES"). That commit now makes it easy to avoid turning the ranged
> > fsyncs into non-ranged fsyncs.
> >
> > This patchset does those two changes. The first patch fixes the bug mentioned
> > before, patches 2 and 3 are preparation cleanups for patch 4, which is the
> > one that makes fsync respect the given file range when using NO_HOLES.
> >
> > V3: Updated patch one so that the ranged is set to full before locking the
> >     inode. To make sure we do writeback and wait for ordered extent
> >     completion as much as possible before locking the inode.
> >     Remaining patches are unchanged.
> >
> > V2: Added one more patch to the series, which is the first patch, that
> >     fixes the bug regarding missing holes after doing a ranged fsync.
> >
> >     The remaining patches remain the same, only patch 4 had a trivial
> >     conflict when rebasing against patch 1 and got its changelog
> >     updated. Now all fstests pass with version 2 of this patchset.
> >
> > Filipe Manana (4):
> >   Btrfs: fix missing file extent item for hole after ranged fsync
> >   Btrfs: add helper to get the end offset of a file extent item
> >   Btrfs: factor out inode items copy loop from btrfs_log_inode()
> >   Btrfs: make ranged full fsyncs more efficient
>
> Moved from for-next to misc-next, thanks.

Btw, Josef's reviewed-by tag is missing in the changelog of patch 4
(however there's an unusual reviewed-by tag from you).
Thanks.

  reply	other threads:[~2020-03-13 11:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 12:41 [PATCH v3 0/4] Btrfs: make ranged fsyncs always respect the given range fdmanana
2020-03-09 12:41 ` [PATCH v3 1/4] Btrfs: fix missing file extent item for hole after ranged fsync fdmanana
2020-03-09 12:41 ` [PATCH v3 2/4] Btrfs: add helper to get the end offset of a file extent item fdmanana
2020-03-09 12:41 ` [PATCH v3 3/4] Btrfs: factor out inode items copy loop from btrfs_log_inode() fdmanana
2020-03-09 12:41 ` [PATCH v3 4/4] Btrfs: make ranged full fsyncs more efficient fdmanana
2020-03-11 17:44 ` [PATCH v3 0/4] Btrfs: make ranged fsyncs always respect the given range Josef Bacik
2020-03-12 20:33 ` David Sterba
2020-03-13 11:01   ` Filipe Manana [this message]
2020-03-13 13:17     ` 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='CAL3q7H42gkjx83Eqd1sfvtqOcj0k4BjLLr-k-C=mA2COcw1dEA@mail.gmail.com' \
    --to=fdmanana@kernel.org \
    --cc=dsterba@suse.cz \
    --cc=josef@toxicpanda.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).