[LCP]Problem reading file with O_DIRECT

Manisha Maheshwari maheshwari.manisha at gmail.com
Thu Jul 6 07:18:04 UTC 2006


I am having problem reading file if  the file is opened with O_DIERCT
flag.The error given by read system call is 'Bad Address'.
The buffer where i am trying to read is a device that is mapped into the
process address space.
I have checked that buffer is mapped by looking into the proc/<pid of my
process>/maps.
I am using ext2 filesysytem with blocksize is 2048.
The address where i am trying to read is block aligned(i.e 2048
byte aligned) and the number of bytes i am trying to read is also multiple
of 2048.
I am using kernel release:2.6.XXX.

I couldn't understand why it's creating problem with O_DIRECT because the
program works if i open file without O_DIRECT or if i create temporary
buffer for read function.

-manisha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/linuxcprogramming/attachments/20060706/a2282862/attachment.htm 


More information about the linuxCprogramming mailing list