All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2]  btrfs fiemap related BUG fix.
@ 2018-03-07  8:20 robbieko
  2018-03-07  8:20 ` [PATCH 1/2] Btrfs: fiemap: pass correct bytenr when fm_extent_count is zero robbieko
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: robbieko @ 2018-03-07  8:20 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Robbie Ko

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

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

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-03-27 16:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2018-03-27 16:51 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.