Subject: Re: kern/6652: swapping to a sparse file fails unpredictably.
To: Marc Horowitz <marc@mit.edu>
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 <marc@mit.edu>
    Message-ID:  <t53lnjh1czj.fsf@rover.cygnus.com>

  | Daniel Carosone <dan@geek.com.au> 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...

kre