Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: strange vnd disk behavior in -current (with ffs2?) (Markus W Kilbinger) writes:

>Hmm, what does a program 'see' if it opens such a sparse file and
>tries to read a sparse region out of it? An error message? Zero-d /
>random data without a read error?

It reads zeros. Writing to a sparse area will allocate the
disk blocks (and may fail due to a full disk).

>Ok, if it's really a limitation of vnd(4) then how to ensure that it
>does not run into this sparse file problem?

Usually you know that you created a sparse file :)

>Should vnconfig(8) check
>for sparse files? Just to rely on users care seems not to be
>sufficient (in my case ;-))...

vnd is supposed to return I/O errors when accessing unallocated
blocks like a real disk device that cannot access a particular block.

AFAIK vnd itself doesn't panic nor should the kernel if you access
the vnd device. Things are different for a mounted filesystem,
some do respond to I/O errors in the underlying device with a panic.

                                Michael van Elst
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index