holes in files

Barry Margolin barmar at think.com
Thu Dec 27 06:05:35 AEST 1990


In article <11749 at alice.att.com> andrew at alice.att.com (Andrew Hume) writes:
>	I rate this as a completely fatuous answer, devoid of
>use and common sense. i had a similar problem. a network server
>gets a request from a client to store a file of given length.
>it is not permissible to say yes and then say no halfway through
>the file. 

Sounds like a pretty unrobust protocol.  A simple protocol can't be
expected to deal with complicated situations.

>	   i do it by writing zeros to the given length first
>and then saying yes/no and then read/write the actual data.
>when do i do the df, exactly? actually, from what this thread has
>uncovered, it might be safer to write non-zero data to avoid
>smart filesystems. what scares me more are hyperintelligent
>disk drives that have built in data compression and might be able
>to take 20 blocks of some values but not be able to overwrite them
>because of different compression rates.

A more immediate fear should be WORM read-write file systems.  I don't know
about the current generation of WORM FS standards, but a proposal I saw
several years ago at MIT specified that any time a block is modified such
that a 1 bit is replaced with a 0 bit a new block is allocated for the new
contents of the block, the old block is marked obsolete, and the inode is
changed to point to the new block (WORM media is like paper tape and
punched cards -- you can add 1 bits, but you can't take any way).  Thus,
overwriting a non-zero block could result in a file system full error!
--
Barry Margolin, Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.unix.internals mailing list