The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Sébastien Dugué" <sebastien.dugue@bull.net>
To: Joel Becker <Joel.Becker@oracle.com>
Cc: "pbadari@us.ibm.com" <pbadari@us.ibm.com>,
	Daniel McNeil <daniel@osdl.org>,
	"suparna@in.ibm.com" <suparna@in.ibm.com>,
	Andrew Morton <akpm@osdl.org>,
	"linux-aio kvack.org" <linux-aio@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.6.10 -  direct-io async short read bug
Date: Wed, 09 Mar 2005 10:50:59 +0100	[thread overview]
Message-ID: <1110361859.14594.44.camel@frecb000686> (raw)
In-Reply-To: <20050309040757.GY27331@ca-server1.us.oracle.com>

Le mardi 08 mars 2005 à 20:07 -0800, Joel Becker a écrit :
> On Tue, Mar 08, 2005 at 03:54:04PM -0800, Badari Pulavarty wrote:
> > > 1. return EINVAL if the DIO goes past EOF.
> > > 
> > > 2. truncate the request to file size (which is what your patch does)
> > >     and if it works, it works.
> > > 
> > > 3. truncate the request to a size that actually works - like a multiple
> > >     of 512.
> > > 
> > > 4. Do the full i/o since the user buffer is big enough, truncate the
> > >     result returned to file size (and clear out the user buffer where it
> > >     read past EOF).
> > > 
> > > Number 4 would make it easy on the user-level code, but AIO DIO might be
> > > a bit tricky and might be a security hole since the data would be dma'ed
> > > there and then cleared.  I need to look at the code some more.
> 
> 	Solaris, which does forcedirectio as a mount option, actually
> will do buffered I/O on the trailing part.  Consider it like a bounce
> buffer.  That way they don't DMA the trailing data and succeed the I/O.
> The I/O returns actual bytes till EOF, just like read(2) is supposed to.
> 	Either this or a fully DMA'd number 4 is really what we should
> do.  If security can only be solved via a bounce buffer, who cares?  If
> the user created themselves a non-aligned file to open O_DIRECT, that's
> their problem if the last part-sector is negligably slower.
> 
> Joel
> 

  From a user's perspective, I tend to agree with Joel. A read going
past EOF should IMHO return the data till EOF and reflect it in the
return value. The penalty incured by the trailing part going buffered
is the price to pay for not having a fully aligned file.

  I think doing otherwise would break read(2) semantics.

  Sébastien.

------------------------------------------------------

  Sébastien Dugué                BULL/FREC:B1-247
  phone: (+33) 476 29 77 70      Bullcom: 229-7770

  mailto:sebastien.dugue@bull.net

  Linux POSIX AIO: http://www.bullopensource.org/posix
  
------------------------------------------------------


  reply	other threads:[~2005-03-09  9:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-07 10:00 [PATCH] 2.6.10 - direct-io async short read bug Sébastien Dugué
2005-03-08  6:39 ` Andrew Morton
2005-03-08  9:09   ` Suparna Bhattacharya
2005-03-08  9:18     ` Andrew Morton
2005-03-08  9:41       ` Suparna Bhattacharya
2005-03-08  9:41         ` Andrew Morton
2005-03-08 10:27           ` Suparna Bhattacharya
2005-03-08 10:27             ` Andrew Morton
2005-03-08 17:23     ` Badari Pulavarty
2005-03-08 19:18       ` Badari Pulavarty
2005-03-08 23:27         ` Daniel McNeil
2005-03-08 23:54           ` Badari Pulavarty
2005-03-09  4:07             ` Joel Becker
2005-03-09  9:50               ` Sébastien Dugué [this message]
2005-03-09 15:20               ` Suparna Bhattacharya
2005-03-09 19:53                 ` Andrew Morton
2005-03-09 21:18                   ` Joel Becker
2005-03-09 21:31                   ` Badari Pulavarty
2005-03-09 22:39                     ` Andrew Morton
2005-03-09 22:45                       ` Badari Pulavarty
2005-03-09  1:44         ` Daniel McNeil
2005-03-09 15:58           ` Badari Pulavarty
  -- strict thread matches above, loose matches on Subject: below --
2005-03-08  9:46 Sébastien Dugué
2005-03-08 10:16 Sébastien Dugué

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=1110361859.14594.44.camel@frecb000686 \
    --to=sebastien.dugue@bull.net \
    --cc=Joel.Becker@oracle.com \
    --cc=akpm@osdl.org \
    --cc=daniel@osdl.org \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbadari@us.ibm.com \
    --cc=suparna@in.ibm.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