Subject: Re: kern/6652: swapping to a sparse file fails unpredictably.
To: Marc Horowitz <>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 01/06/1999 19:57:11
    Date:        05 Jan 1999 19:06:24 -0500
    From:        Marc Horowitz <>
    Message-ID:  <>

  | Daniel Carosone <> writes:
  | >> "ls -ls" will let me determine if a file is sparse

  | And fails if the file uses indirect blocks.

Only if the algorithm used is too simplistic like
	 (size + blocksize - 1) / blocksize

You can always determine exactly how many blocks it takes to cover an entire
file of any given size (on ffs) - if the number of blocks the inode claims is
equal to that, then the file is not sparse, if the number of blocks is less
then the file is sparse, if it is greater, the filesystem is broken...