Re: [PATCH] xfs: rewrite getbmap using the xfs_iext_* helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 28, 2017 at 02:01:25PM -0700, Darrick J. Wong wrote:
> Aha, I see, it's only if you pass in -e to xfs_bmap then you get a hole record:

Good luck passing -e to xfs_bmap:

root@brick:/home/hch/work/xfsprogs# xfs_bmap -e foo
Illegal option -e
Usage: xfs_bmap [-adlpvV] [-n nx] file...

:)


> 
> $ truncate -s 50m /storage/tmp/a
> $ xfs_io -c 'bmap -elpv' /storage/tmp/a
> /storage/tmp/a:
>  EXT: FILE-OFFSET      BLOCK-RANGE      AG AG-OFFSET         TOTAL FLAGS
>    0: [0..102399]:     hole                                 102400
> $ xfs_bmap /storage/tmp/a
> /storage/tmp/a: no extents
> $ xfs_io -c 'bmap -lpv' /storage/tmp/a
> /storage/tmp/a: no extents
> 
> (eesh.)

But only if there are no other extents:

root@brick:/home/hch/work/xfsprogs# truncate -s 50m foo
root@brick:/home/hch/work/xfsprogs# xfs_io -c 'bmap -elpv' foo
foo:
 EXT: FILE-OFFSET      BLOCK-RANGE      AG AG-OFFSET         TOTAL FLAGS
   0: [0..102399]:     hole                                 102400
root@brick:/home/hch/work/xfsprogs# echo bar > foo
root@brick:/home/hch/work/xfsprogs# xfs_io -c 'bmap -elpv' foo
foo:
 EXT: FILE-OFFSET      BLOCK-RANGE          AG AG-OFFSET        TOTAL FLAGS
   0: [0..7]:          730691408..730691415  3 (390992..390999)     8 000000

I think we need to actually define getbmap semantics, as it seems
to be a collection of accidental corner cases..
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux