All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Isaacson <adi@hexapodia.org>
To: Paul Eggert <eggert@CS.UCLA.EDU>
Cc: Andrew Morton <akpm@osdl.org>,
	bug-coreutils@gnu.org, linux-kernel@vger.kernel.org
Subject: Re: dd PATCH: add conv=direct
Date: Wed, 7 Apr 2004 16:09:50 -0500	[thread overview]
Message-ID: <20040407210950.GG2814@hexapodia.org> (raw)
In-Reply-To: <87vfkbms7s.fsf@penguin.cs.ucla.edu>

On Wed, Apr 07, 2004 at 01:46:31PM -0700, Paul Eggert wrote:
> Andrew Morton <akpm@osdl.org> writes:
> > In 2.6 we do the check at open() and fcntl() time.  In 2.4 we don't
> > fail until the actual I/O attempt.
> 
> This raises the issue of what "dd conv=direct" should do in 2.4
> kernels.  I propose that it should report an error and exit, when the
> write fails, since conv=direct can't be implemented.  The basic idea
> is that on systems that lack direct I/O, conv=direct should fail.

I agree, this is the appropriate behavior.  When "dd conv=direct" is
used on a fd that cannot support direct I/O, and the kernel doesn't tell
us until it's too late, erroring on the I/O is the only sane action.

Fortuitously, that's what happens with the patches I posted.

(Note that it's a function of the kernel and the underlying FS whether
direct I/O is going to work.  So some kind of heuristic on kernel
version is a bad idea.)

> Another issue with this patch: in Solaris, direct I/O is done by
> invoking directio(DIRECTIO_ON); see
> <http://docs.sun.com/db/doc/816-0213/6m6ne37so?q=directio&a=view>.
> Is Solaris direct I/O a direct analog to Linux direct I/O, or are
> there subtle differences in semantics that should be made visible to
> the users of GNU "dd"?

The Solaris semantics are more sane than the Linux ones, to be sure --
it always does the I/O, falling back to buffered I/O if conditions are
not right for direct.

I don't believe I have a test system for the Solaris case (when was
directio(3C) added?) so someone else will have to add that support.

-andy

  parent reply	other threads:[~2004-04-07 21:09 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 22:03 dd PATCH: add conv=direct Andy Isaacson
2004-04-07  0:33 ` Andrew Morton
2004-04-07 16:21   ` Bruce Allen
2004-04-07 16:42     ` Andrew Morton
2004-04-07 17:31   ` Andy Isaacson
2004-04-07 18:18     ` Andrew Morton
2004-04-07 19:24       ` Andy Isaacson
2004-04-07 19:34         ` Andrew Morton
2004-04-07 19:47           ` Andy Isaacson
2004-04-07 20:03             ` Andrew Morton
2004-04-07 20:43               ` Andy Isaacson
2004-04-07 21:00                 ` Valdis.Kletnieks
2004-04-07 21:35                 ` Bruce Allen
2004-04-08  6:56                   ` Paul Eggert
2004-04-08 11:07                     ` Jim Meyering
2004-04-08 19:32                       ` Paul Eggert
2004-04-08 19:51                         ` Paul Jarc
2004-04-08 21:34                         ` Jim Meyering
2004-04-08 16:23                     ` Philippe Troin
2004-04-08 20:20                       ` dd patch to remove noctty Paul Eggert
2004-04-08 21:40                         ` Jim Meyering
2004-04-09  0:37             ` dd PATCH: add conv=direct Anton Blanchard
2004-04-09  1:42               ` Wim Coekaerts
2004-04-10 21:28                 ` Jim Meyering
2004-04-07 20:46       ` Paul Eggert
2004-04-07 21:06         ` Andrew Morton
2004-04-07 21:09         ` Andy Isaacson [this message]
2004-04-07 19:12     ` Miquel van Smoorenburg
2004-04-07 20:14       ` Andy Isaacson
2004-04-07 22:02 ` Nathan Straz
2004-04-07 22:09   ` Andy Isaacson
2004-04-08 11:44     ` Miquel van Smoorenburg

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=20040407210950.GG2814@hexapodia.org \
    --to=adi@hexapodia.org \
    --cc=akpm@osdl.org \
    --cc=bug-coreutils@gnu.org \
    --cc=eggert@CS.UCLA.EDU \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.