xfs
[Top] [All Lists]

Re: Strage values from FIBMAP on holes or after end of file

To: "Gonyou, Austin" <austin@xxxxxxxxxxxxxxx>
Subject: Re: Strage values from FIBMAP on holes or after end of file
From: utz lehmann <xfs@xxxxxxxxxx>
Date: Fri, 3 Aug 2001 00:55:41 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <85063BBE668FD411944400D0B744267A6435E7@AUSMAIL>
References: <85063BBE668FD411944400D0B744267A6435E7@AUSMAIL>
Sender: owner-linux-xfs@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
No.

The HOLE file has 3 4K Blocks. The first contains "hole\n" and padded the
rest to 4K with NUL chars. The second block is a hole, never written to it
(seek=2). It reads like 4K NUL chars. The 3rd contains only "hole\n".

Only the 1st and 3rd block are phsically on disk. 

The FIBMAP ioctl returns the physical blocks of the blockdevice for a
fileblock.

1st fileblock: 452112 - 452119 on disk (512byte blocks for XFS)
2nd fileblock: not on disk
3rd fileblock: 452104 - 452111 on disk


but i think the FIBMAP ioctl should return 0 as blocknumber for holes and
after the end of the file.


utz

Gonyou, Austin [austin@xxxxxxxxxxxxxxx] wrote:
> So does this mean that there are 8 blocks wasted for every file write?
> 
> -- 
> Austin Gonyou
> Systems Architect, CCNA
> Coremetrics, Inc.
> Phone: 512-796-9023
> email: austin@xxxxxxxxxxxxxxx 
> 
> > -----Original Message-----
> > From: utz lehmann [mailto:xfs@xxxxxxxxxx]
> > Sent: Thursday, August 02, 2001 5:20 PM
> > To: linux-xfs@xxxxxxxxxxx
> > Subject: Strage values from FIBMAP on holes or after end of file
> > 
> > 
> > Hi
> > 
> > The FIBMAP ioctl on holes or after end of file gives the 
> > values -1 to 6.
> > ext2 and reiserfs reurns 0. I thing this is the right value.
> > 
> > The attached programm FIBMAPs the first 32 512byte blocks of a file.
> > 
> > # echo hole >HOLE
> > # echo hole | dd of=HOLE bs=4096 seek=2
> > # ./fib HOLE
> >         0 [0]: 452112
> >         1 [0]: 452113
> >         2 [0]: 452114
> >         3 [0]: 452115
> >         4 [0]: 452116
> >         5 [0]: 452117
> >         6 [0]: 452118
> >         7 [0]: 452119
> >         8 [0]: -1
> >         9 [0]: 0
> >        10 [0]: 1
> >        11 [0]: 2
> >        12 [0]: 3
> >        13 [0]: 4
> >        14 [0]: 5
> >        15 [0]: 6
> >        16 [0]: 452104
> >        17 [0]: 452105
> >        18 [0]: 452106
> >        19 [0]: 452107
> >        20 [0]: 452108
> >        21 [0]: 452109
> >        22 [0]: 452110
> >        23 [0]: 452111
> >        24 [0]: -1
> >        25 [0]: 0
> >        26 [0]: 1
> >        27 [0]: 2
> >        28 [0]: 3
> >        29 [0]: 4
> >        30 [0]: 5
> >        31 [0]: 6
> > 
> > Blocks 8 - 15 are the hole. Block 23 ist the last block of the file.
> > 
> > 
> > utz
> > 


<Prev in Thread] Current Thread [Next in Thread>