[net.unix-wizards] When write

hans@log-hb.UUCP (Hans J. Albertsson) (11/23/85)

[]
When a write to a raw disk partition returns, is anything known
concerning whether data is actually on the disk or not?

I know, I can read the source code, but, still, I'd like to know in
general terms. Does UNIX in itself guarantee that data is actually on the
disk?


-- 
 Two's complement, but three's an int....
Hans Albertsson EIS, USENET/uucp: ...!mcvax!enea!log-hb!hans

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (11/25/85)

> When a write to a raw disk partition returns, is anything known
> concerning whether data is actually on the disk or not?

Yes, the transfer is by DMA from user address space and it is
complete when the write() system call returns.  Block buffers
are not used for raw disk I/O.  Further, EIO is supposed to
be returned if the write fails; this is much better than in
the case of block I/O if you are concerned with reliability.

snoopy@ecrcvax.UUCP (Sebastian Schmitz) (11/28/85)

Summary:
Expires:
References: <log-hb.325>
Sender:
Reply-To: snoopy@ecrcvax.UUCP (Sebastian Schmitz)
Followup-To:
Distribution:
Organization: European Computer-Industry Research Centre, Munchen, W. Germany
Keywords:


Actually when a write returns, one knows awfully little: here
is a little excerpt, one of my colleagues found in a book. Its
quite amusing, but correct, so I guess I'll put in in this bb.

Love,
Seb

Excerpt follows:

/***** ecrcvax:jokes / phoebe!micha /  8:25 am  Nov 19, 1985*/
I quote here a paragraph from the book "Advanced UN*X Programming" by
M.J.Rochkind that may reveal some of the characteristics of the system.
It describes what would the system tell you (if it could speak) when you
issue a 'write' system call (low level I/O, writes a buffer on the disc):

   I've taken note of your request, and rest assured that your file descriptor
is OK, I've copied your data successfully, and there's enough disc space.
Later, when it's convenient for me, and if I'm still alive, I'll try to put
your data on the disc where it belongs. If I discover an error, then I'll try
to print something on the console, but I won't tell you about it (indeed, you
may have terminated by then). If you, or any of the other process, tries to
read this data before I've written it out, I'll give it to you from the
buffer cache, so, if all goes well, you'll never be able to find
out when and if I've completed your request. You may ask no further
questions. Trust me. And thank me for the speed reply.

/* ---------- */
-- 
  Love,
  Sebastian (Snoopy)

"You haven't done it, till you've done it with pointers"

\!mcvax\!unido\!ecrcvax\!snoopy /* N.B. valid csh address */

chris@umcp-cs.UUCP (Chris Torek) (11/29/85)

In article <171@ecrcvax.UUCP> snoopy@ecrcvax.UUCP (Sebastian Schmitz)
describes how little is assured by the successful return of a write
system call.  What is said is correct, but does NOT apply to I/O
on raw devices.  A successful write on a raw device guarantees that
your data has reached the peripheral.  Whether it has been indelibly
inscribed depends on the device.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@mimsy.umd.edu