mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel McNeil <daniel@osdl.org>
To: Hayim Shaul <hayim@post.tau.ac.il>
Cc: Benjamin LaHaise <bcrl@kvack.org>,
	Suparna Bhattacharya <suparna@in.ibm.com>,
	Andrew Morton <akpm@osdl.org>,
	"linux-aio@kvack.org" <linux-aio@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Latest AIO patchset
Date: 26 Feb 2004 08:45:02 -0800	[thread overview]
Message-ID: <1077813902.1956.282.camel@ibm-c.pdx.osdl.net> (raw)
In-Reply-To: <Pine.LNX.4.44.0402261525460.29206-100000@soul.math.tau.ac.il>

Are you checking the return value of write()?

O_DIRECT has alignment requirements since it writes directly from
user-space to disk by passing the page cache.  Also the size
of the write has to be a multiple of 512 (for 2.6).
Try using posix_memalign() with pagesize as the alignment arg
to allocated the data buffer.  O_DIRECT does work on ext3.

Daniel

On Thu, 2004-02-26 at 05:30, Hayim Shaul wrote:
> On Wed, 25 Feb 2004, Benjamin LaHaise wrote:
> 
> > On Wed, Feb 25, 2004 at 08:45:29PM +0200, Hayim Shaul wrote:
> > > What exactly is the O_DIRECT flag? When I add this flag to the open func
> > > it fails.
> > > 
> > > More specificaly, this function fails
> > >   open("filename", O_RDWR | O_DIRECT | O_LARGEFILE | O_CREAT, S_IRWXU);   
> > > 
> > > but this one succeeds
> > >   open("filename", O_RDWR | O_LARGEFILE | O_CREAT, S_IRWXU);   
> > > 
> > > I'm running linux 2.6.0 with libaio 0.3.92.
> > 
> > Which filesystem?  Not all support O_DIRECT.
> > 
> 
> ext3
> I'm think it does support ext3.
> 
> Actually, I was wrong. open does succeed. It return a valid fd
> but after writing and exiting, the file is still zero size.
> 
> removing the O_DIRECT with the same prog writes quite alot to the file.
> 
> Hayim.
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-aio' in
> the body to majordomo@kvack.org.  For more info on Linux AIO,
> see: http://www.kvack.org/aio/
> Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>


      reply	other threads:[~2004-02-26 16:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-24 16:03 Suparna Bhattacharya
2004-02-24 11:02 ` kexec "problem" Carlos Silva
2004-02-24 17:10   ` Randy.Dunlap
2004-02-24 17:24     ` Carlos Silva
2004-02-27  0:54   ` kexec "problem" [and patch updates] Randy.Dunlap
2004-02-27  8:00     ` [Fastboot] " Eric W. Biederman
2004-02-27 19:32       ` Randy.Dunlap
2004-02-28 10:41         ` Eric W. Biederman
2004-03-04 13:03           ` Hariprasad Nellitheertha
2004-03-08  0:32             ` Eric W. Biederman
2004-03-08 18:35             ` Randy.Dunlap
2004-02-25 18:45 ` Latest AIO patchset Hayim Shaul
2004-02-26  0:27   ` Benjamin LaHaise
2004-02-26 13:30     ` Hayim Shaul
2004-02-26 16:45       ` Daniel McNeil [this message]

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=1077813902.1956.282.camel@ibm-c.pdx.osdl.net \
    --to=daniel@osdl.org \
    --cc=akpm@osdl.org \
    --cc=bcrl@kvack.org \
    --cc=hayim@post.tau.ac.il \
    --cc=linux-aio@kvack.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®