From owner-freebsd-fs@FreeBSD.ORG Sat Feb 3 13:36:48 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB7016A402 for ; Sat, 3 Feb 2007 13:36:48 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id A0D5D13C442 for ; Sat, 3 Feb 2007 13:36:47 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id l13D2ZEW063667; Sat, 3 Feb 2007 14:02:35 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id l13D2Rx7027173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 3 Feb 2007 14:02:27 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id l13D2RFf077603; Sat, 3 Feb 2007 14:02:27 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id l13D2Rgd077602; Sat, 3 Feb 2007 14:02:27 +0100 (CET) (envelope-from ticso) Date: Sat, 3 Feb 2007 14:02:27 +0100 From: Bernd Walter To: Oliver Fromme Message-ID: <20070203130226.GO70860@cicely12.cicely.de> References: <200702022005.l12K5mli017338@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200702022005.l12K5mli017338@lurza.secnetix.de> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on cicely12.cicely.de Cc: freebsd-fs@freebsd.org Subject: Re: Mysterious block count (reproducible) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Feb 2007 13:36:48 -0000 On Fri, Feb 02, 2007 at 09:05:48PM +0100, Oliver Fromme wrote: > Hi > > The following is on a standard UFS2 file system under > FreeBSD 6.2, block size 16 KB, fragsize 2 KB. The > filesystems are perfectly ok and fsck-clean. There > haven't been any physical disk errors either. > > I've got a file on my home partition that's 214848 bytes. > According to math it should occupy 14 blocks. However: > > $ BLOCKSIZE=16K ls -s foo > 15 foo > > I copied the file to /tmp (which is an mdfs, also UFS2 > with default parameters). Same result. I created a > fresh file from /dev/zero of 214848 bytes. The same. > > Where does the 15th block come from? Those additional > 16 KB must be used for _something_ somewhere ... > > fsdb(8) isn't helpful either: > > # fsdb -r /dev/md0 > fsdb (inum: 2)> ls > [...] > slot 7 ino 5 reclen 20: regular, `foo' > fsdb (inum: 2)> inode 5 > current inode: regular file > I=5 MODE=100600 SIZE=214848 > BTIME=Feb 2 20:46:02 2007 [0 nsec] > MTIME=Feb 2 20:46:02 2007 [0 nsec] > CTIME=Feb 2 20:46:02 2007 [0 nsec] > ATIME=Feb 2 20:46:58 2007 [0 nsec] > OWNER=root GRP=wheel LINKCNT=1 FLAGS=0 BLKCNT=1e0 GEN=ffffffffe2ca5220 > > 0x1e0 is 224 (== 14 * 16). So fsdb(8) doesn't see the > 15th block either. To confirm: > > fsdb (inum: 5)> blocks > Blocks for inode 5: > Direct blocks: > 2136, 2144, 2152, 2160, 2168, 2176, 2184, 2192, 2248, 2256, 2264, 2272 > Indirect blocks: > 2280, 2288, > fsdb (inum: 5)> > > It lists 12 direct blocks and 2 indirect blocks, that's > still 14 blocks, not 15. > > Where did the 15th block go?!? Or is there a bug in > the calculation of ls -s output? Don't forget the block needed for the indirect table. fsdb only shows data blocks it seems. -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de