From: Filipe Manana <fdmanana@kernel.org>
To: Omar Sandoval <osandov@osandov.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: fix invalid extent maps due to hole punching
Date: Wed, 31 May 2017 11:09:54 +0100 [thread overview]
Message-ID: <CAL3q7H7RGod2ytegL3YnxJ=bbitsQg7UEC2kk_p7UuHzCuwwKA@mail.gmail.com> (raw)
In-Reply-To: <20170530205057.GA11921@vader.DHCP.thefacebook.com>
On Tue, May 30, 2017 at 9:50 PM, Omar Sandoval <osandov@osandov.com> wrote:
> On Sun, May 28, 2017 at 05:31:53PM +0100, fdmanana@kernel.org wrote:
>> From: Filipe Manana <fdmanana@suse.com>
>
> [snip]
>
> Hey, Filipe,
>
> I saw this warning and tried to apply your patch, but it doesn't apply
> cleanly (seems to conflict with 9986277e0e4c ("Btrfs: handle only
> applicable errors returned by btrfs_get_extent")).
Yes, it was based on an older branch.
I'll rebase it. Thanks.
>
>> Fixes: d77815461f04 ("btrfs: Avoid trucating page or punching hole in a already existed hole.")
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Filipe Manana <fdmanana@suse.com>
>> ---
>> fs/btrfs/file.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
>> index f7d022bc7998..2645d820422c 100644
>> --- a/fs/btrfs/file.c
>> +++ b/fs/btrfs/file.c
>> @@ -2390,10 +2390,12 @@ static int fill_holes(struct btrfs_trans_handle *trans,
>> */
>> static int find_first_non_hole(struct inode *inode, u64 *start, u64 *len)
>> {
>> + struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
>> struct extent_map *em;
>> int ret = 0;
>>
>> - em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, *start, *len, 0);
>> + em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, *start,
>> + round_up(*len, fs_info->sectorsize), 0);
>> if (IS_ERR_OR_NULL(em)) {
>> if (!em)
>> ret = -ENOMEM;
>> --
>> 2.11.0
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-05-31 10:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-28 16:31 [PATCH] Btrfs: fix invalid extent maps due to hole punching fdmanana
2017-05-28 21:31 ` [PATCH v2] " fdmanana
2017-05-31 20:32 ` Liu Bo
2017-06-01 10:52 ` Filipe Manana
2017-05-30 4:52 ` [PATCH v3] " fdmanana
2017-06-01 17:49 ` Liu Bo
2017-05-30 20:50 ` [PATCH] " Omar Sandoval
2017-05-31 10:09 ` Filipe Manana [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='CAL3q7H7RGod2ytegL3YnxJ=bbitsQg7UEC2kk_p7UuHzCuwwKA@mail.gmail.com' \
--to=fdmanana@kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=osandov@osandov.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).