From: Joel Becker <jlbec@evilplan.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: O_DIRECT wierd behavior..
Date: Mon, 17 Dec 2001 20:20:56 +0000 [thread overview]
Message-ID: <20011217202056.L31706@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20011217195312.K31706@parcelfarce.linux.theplanet.co.uk> <Pine.LNX.4.33.0112171156380.1380-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0112171156380.1380-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Mon, Dec 17, 2001 at 11:59:56AM -0800
On Mon, Dec 17, 2001 at 11:59:56AM -0800, Linus Torvalds wrote:
> On Mon, 17 Dec 2001, Joel Becker wrote:
> > /* Smart program handles partial writes */
> > write(100k); = 50k
> > write(remaining 50k); = -1/ENOSPC|EIO|etc
>
> We do this, if the error is "hard". And "fatal" implies hardness, so we're
> ok here.
Right. "hard" is also synonymous with "non-transient".
> > /* Dumb program doesn't handle partial write */
> > write(100k); = 50k
> > close(fd); = -1/EIO
>
> But we're not doing this.
IMHO we should be, and not just to comply with the letter of
SUS/Unix98. SUS specifies this behavior because a synchronous write()
can return after copying data to the buffer cache. However, the EIO can
happen later when the buffer cache is trying to flush to disk. The only
way for an application to see this error is to either run O_SYNC or
receive it upon close().
Joel
--
"Every day I get up and look through the Forbes list of the richest
people in America. If I'm not there, I go to work."
- Robert Orben
http://www.jlbec.org/
jlbec@evilplan.org
next prev parent reply other threads:[~2001-12-17 20:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-16 0:47 O_DIRECT wierd behavior Suresh Gopalakrishnan
2001-12-16 5:59 ` Andrew Morton
2001-12-16 8:17 ` GOTO Masanori
2001-12-16 8:46 ` Andrew Morton
2001-12-16 9:20 ` Suresh Gopalakrishnan
2001-12-16 13:57 ` Terje Eggestad
2001-12-16 17:43 ` Suresh Gopalakrishnan
2001-12-17 9:04 ` Terje Eggestad
2001-12-17 17:18 ` Andrea Arcangeli
2001-12-17 18:07 ` Hugh Dickins
2001-12-17 18:13 ` Andrea Arcangeli
2001-12-17 18:57 ` Andrew Morton
2001-12-17 19:26 ` Linus Torvalds
2001-12-17 19:53 ` Joel Becker
2001-12-17 19:59 ` Linus Torvalds
2001-12-17 20:20 ` Joel Becker [this message]
2001-12-17 20:38 ` Andre Hedrick
2001-12-26 14:54 ` Riley Williams
2001-12-16 6:29 ` GOTO Masanori
2002-01-20 4:16 ` multithreaded RPC handling Suresh Gopalakrishnan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011217202056.L31706@parcelfarce.linux.theplanet.co.uk \
--to=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox