From: David Sterba <dsterba@suse.cz>
To: Liu Bo <obuil.liubo@gmail.com>
Cc: David Sterba <dsterba@suse.cz>, Liu Bo <bo.liu@linux.alibaba.com>,
linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: do not abort transaction when failing to insert hole extent
Date: Tue, 10 Apr 2018 14:12:14 +0200 [thread overview]
Message-ID: <20180410121214.GC2817@twin.jikos.cz> (raw)
In-Reply-To: <CANQeFDCV5p+t0kLDHjrTmeT6_S9U-zLHP5c0btR_UbtON-TpaA@mail.gmail.com>
On Mon, Apr 09, 2018 at 06:23:14PM -0700, Liu Bo wrote:
> >>> As maybe_insert_hole is only called by btrfs_cont_expand here, which
> >>> means it's a really hole, I don't expect drop_extents would drop
> >>> anything, we can remove this drop_extents and put an assert after
> >>> btrfs_insert_file_extent for checking EEXIST.
> >> Sounds good.
> > Let me make a v2 and have a fstests run.
> It turns out that the btrfs_drop_extents() here is quite necessary
> since fallocate(2) has a FALLOC_FL_KEEP_SIZE option, and when that
> happens, a hole extent would be appended between the EOF and fallocate
> range's start, then a later truncate up would have to drop these hole
> extents in order to expand with a new hole...
Would it make sense to split the cases where FALLOC_FL_KEEP_SIZE is and
is not used? Either passing an argument or 2 functions where one could
avoid the drop. I've looked at the code only briefly, so this may be a
nonsense in the end.
> As I don't see a way to gracefully solve this except keeping
> drop_extents(), lets drop this patch instead.
Understood.
next prev parent reply other threads:[~2018-04-10 12:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-30 22:11 [PATCH] Btrfs: do not abort transaction when failing to insert hole extent Liu Bo
2018-04-05 16:48 ` David Sterba
2018-04-05 18:58 ` Liu Bo
2018-04-06 13:21 ` David Sterba
2018-04-06 17:43 ` Liu Bo
2018-04-10 1:23 ` Liu Bo
2018-04-10 12:12 ` David Sterba [this message]
2018-04-12 1:39 ` Liu Bo
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=20180410121214.GC2817@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=bo.liu@linux.alibaba.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=obuil.liubo@gmail.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).