From: robbieko <robbieko@synology.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/2] btrfs fiemap related BUG fix.
Date: Wed, 07 Mar 2018 17:53:06 +0800 [thread overview]
Message-ID: <ff8a384426d5eb2758f8fa5248e77826@synology.com> (raw)
In-Reply-To: <26835a31-1dc4-98f3-f37c-44e8c73d6d67@gmx.com>
Qu Wenruo 於 2018-03-07 17:27 寫到:
> On 2018年03月07日 16:20, robbieko wrote:
>> From: Robbie Ko <robbieko@synology.com>
>>
>> This patchset intends to fix btrfs fiemap related bug.
>>
>> The fiemap has the following problems:
>>
>> 1) Wrong extent count when fm_extent_count is zero.
>>
>>
>> 2) SHARED bit is not correct
>> I have two ideas, but I do not know which one is the best.
>>
>> Like:
>> # dd if=/dev/zero bs=16K count=2 oflag=dsync of=/mnt/btrfs/file
>> # xfs_io -c "fiemap -v" /mnt/btrfs/file
>> /mnt/btrfs/file:
>> EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
>> 0: [0..63]: 4241424..4241487 64 0x1
>> # cloner -s $((16*1024)) /mnt/btrfs/file /mnt/btrfs/file_clone
>>
>> 1. When any extent is shared in extent map, the entire extent map is
>> shared
>> # xfs_io -c "fiemap -v" /mnt/btrfs/file
>> /mnt/btrfs/file:
>> EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
>> 0: [0..63]: 4241424..4241487 64 0x2001
>
> I think this is what btrfs is doing right now.
> Although I'm not sure if this is the best solution.
>
> BTW, I just did the same operation, and just get the SHARED flag on
> both
> source and destination.
>
> Is there something wrong?
>
Currently, only the first extent is checked for shared in extent_map.
Details can refer to "[PATCH 2/2] Btrfs: fix fiemap extent SHARED flag
error with range clone."
>>
>> 2. Split into different extent
>> # xfs_io -c "fiemap -v" /mnt/btrfs/file
>> /mnt/btrfs/file:
>> EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
>> 0: [0..31]: 4241424..4241455 32 0x0
>> 1: [32..63]: 4241456..4241487 32 0x2001
>
> This is what XFS does.
>
> Thanks,
> Qu
>
>>
>> Robbie Ko (2):
>> Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero
>> Btrfs: fix fiemap extent SHARED flag error with range clone.
>>
>> fs/btrfs/extent_io.c | 150
>> ++++++++++++++++++++++++++++++++++++++++++++-------
>> 1 file changed, 132 insertions(+), 18 deletions(-)
>>
>> --
>> 1.9.1
>>
>> --
>> 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
>>
next prev parent reply other threads:[~2018-03-07 9:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-07 8:20 [PATCH 0/2] btrfs fiemap related BUG fix robbieko
2018-03-07 8:20 ` [PATCH 1/2] Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero robbieko
2018-03-07 10:19 ` Nikolay Borisov
2018-03-07 10:27 ` robbieko
2018-03-07 11:15 ` Nikolay Borisov
2018-03-09 9:01 ` robbieko
2018-03-09 9:18 ` Nikolay Borisov
2018-03-07 8:20 ` [PATCH 2/2] Btrfs: fix fiemap extent SHARED flag error with range clone robbieko
2018-03-07 10:33 ` Qu Wenruo
2018-03-07 10:42 ` Qu Wenruo
2018-03-07 11:01 ` robbieko
2018-03-07 11:18 ` Qu Wenruo
2018-03-07 11:27 ` Nikolay Borisov
2018-03-07 12:14 ` Qu Wenruo
2018-03-07 12:17 ` Nikolay Borisov
2018-03-07 12:29 ` Qu Wenruo
2018-03-07 9:27 ` [PATCH 0/2] btrfs fiemap related BUG fix Qu Wenruo
2018-03-07 9:53 ` robbieko [this message]
2018-03-27 16:51 ` 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=ff8a384426d5eb2758f8fa5248e77826@synology.com \
--to=robbieko@synology.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.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).