Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f72NWJ807701 for linux-xfs-outgoing; Thu, 2 Aug 2001 16:32:19 -0700 Received: from moutvdom01.kundenserver.de (moutvdom01.kundenserver.de [195.20.224.200]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f72NWGV07675 for ; Thu, 2 Aug 2001 16:32:16 -0700 Received: from [195.20.224.208] (helo=mrvdom01.schlund.de) by moutvdom01.kundenserver.de with esmtp (Exim 2.12 #2) id 15SRwt-0001qQ-00; Fri, 3 Aug 2001 01:32:15 +0200 Received: from pd901e258.dip.t-dialin.net ([217.1.226.88] helo=kernelpanix.aura.of.mankind) by mrvdom01.schlund.de with esmtp (Exim 2.12 #2) id 15SRws-0000Li-00; Fri, 3 Aug 2001 01:32:14 +0200 Received: (from utz@localhost) by kernelpanix.aura.of.mankind (8.11.2/8.11.2) id f72Mtff04433; Fri, 3 Aug 2001 00:55:41 +0200 X-Authentication-Warning: kernelpanix.aura.of.mankind: utz set sender to xfs@s2y4n2c.de using -f Date: Fri, 3 Aug 2001 00:55:41 +0200 From: utz lehmann To: "Gonyou, Austin" Cc: linux-xfs@oss.sgi.com Subject: Re: Strage values from FIBMAP on holes or after end of file Message-ID: <20010803005541.A4343@s2y4n2c.de> References: <85063BBE668FD411944400D0B744267A6435E7@AUSMAIL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <85063BBE668FD411944400D0B744267A6435E7@AUSMAIL> Sender: owner-linux-xfs@oss.sgi.com Precedence: bulk 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@coremetrics.com] 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@coremetrics.com > > > -----Original Message----- > > From: utz lehmann [mailto:xfs@s2y4n2c.de] > > Sent: Thursday, August 02, 2001 5:20 PM > > To: linux-xfs@oss.sgi.com > > 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 > >