Subject: Re: kern/6652: swapping to a sparse file fails unpredictably.
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Marc Horowitz <marc@mit.edu>
List: netbsd-bugs
Date: 01/05/1999 16:53:13
Jason Thorpe <thorpej@nas.nasa.gov> writes:
>> I would say that any attempt to swapon to a sparse file should fail
>> with EINVAL. Same goes for the vnd code.
Well, eventually, growing the file would be nice. But this is a
reasonable start.
We discussed this on ICB a bit. The only issue here is that it would
be nice if there was a non-O(n) way to determine if a file is sparse.
I'm not sure how to do this (or if it even makes sense) in a
filesystem generic way. I think this might be possible using the
indirect block macros, but I'm not ffs-clueful enough to know the
details. If you could give me some clue, or a pointer to it, I'll try
to fix it.
Marc