From: David Sterba <dsterba@suse.cz>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH v2] Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly
Date: Fri, 20 Jan 2017 16:50:09 +0100 [thread overview]
Message-ID: <20170120155009.GB11951@twin.jikos.cz> (raw)
In-Reply-To: <1484237606-17576-1-git-send-email-bo.li.liu@oracle.com>
On Thu, Jan 12, 2017 at 08:13:26AM -0800, Liu Bo wrote:
> btrfs_ordered_update_i_size can be called by truncate and endio, but only endio
> takes ordered_extent which contains the completed IO.
>
> while truncating down a file, if there are some in-flight IOs,
> btrfs_ordered_update_i_size in endio will set disk_i_size to @orig_offset that
> is zero. If truncating-down fails somehow, we try to recover in memory isize
> with this zero'd disk_i_size.
>
> Fix it by only updating disk_i_size with @orig_offset when
> btrfs_ordered_update_i_size is not called from endio while truncating down and
> waiting for in-flight IOs completing their work before recover in-memory size.
>
> Besides fixing the above issue, add an assertion for last_size to double check
> we truncate down to the desired size.
>
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Looks good to me, added to 4.11 queue.
prev parent reply other threads:[~2017-01-20 16:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 16:13 [PATCH v2] Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly Liu Bo
2017-01-20 15:50 ` 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=20170120155009.GB11951@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=bo.li.liu@oracle.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).