xfs
[Top] [All Lists]

Re: O_DIRECT wierd behavior..

To: Stephen Lord <lord@xxxxxxx>
Subject: Re: O_DIRECT wierd behavior..
From: Suresh Gopalakrishnan <gsuresh@xxxxxxxxxxxxxx>
Date: Sat, 15 Dec 2001 21:24:52 -0500 (EST)
Cc: Eric Sandeen <sandeen@xxxxxxx>, Keith Owens <kaos@xxxxxxxxxxxxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <3C1BFAB1.2000008@sgi.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
On Sat, 15 Dec 2001, Stephen Lord wrote:
> Eric Sandeen wrote:
> >On Sun, 16 Dec 2001, Keith Owens wrote:
> >>Works for me using gcc 2.96, glibc 2.2.2.
> >Looks like it may be a glibc thing... under 2.4.14, it works for me on
> >a Red hat 7.1 box (glibc 2.2.), not on a Red Hat 7.2 box (glibc 2.2.4).
> >-Eric

I doubt if it is a glibc issue - i have 2.2.2 on both machines, it works
on the one with 2.4.2 kernel, not on the one with 2.4.16 kernel.

The O_DIRECT flag bits match those in fcntl.h

Another observation by trying to do the same on NFS:

$ ./testio
write returns -1
Filesize limit exceeded (core dumped)
$ ls -l blah
----------    1 gsuresh  users           0 Dec 15 21:16 blah

The same program creates a huge file on ext2:

$ ./testio
write returns -1
Filesize limit exceeded (core dumped)
$ ls -l /tmp/blah
----------    1 gsuresh  users    4294967274 Dec 15 21:19 /tmp/blah

> If you run strace on the program what is going into and out of the
> kernel? Steve

relevant strace output (same for both cases):

open("/tmp/blah", O_RDWR|O_CREAT|O_DIRECT, 0) = 3
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
8192) = -1
 EINVAL (Invalid argument)
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40
018000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "write returns -1\n", 17write returns -1
)      = 17
write(3, "\0", 1)                       = -1 EFBIG (File too large)
--- SIGXFSZ (File size limit exceeded) ---
+++ killed by SIGXFSZ +++ 

--suresh


<Prev in Thread] Current Thread [Next in Thread>