[LCP] Problem reading file with O_DIRECT

Manisha Maheshwari maheshwari.manisha at gmail.com
Sun Jun 3 07:33:04 UTC 2007


Copying linuxcprogramming at lists.linux.org.au ....

---------- Forwarded message ----------
From: Manisha Maheshwari <maheshwari.manisha at gmail.com>
Date: Jun 3, 2007 12:31 AM
Subject: Re: [LCP]Problem reading file with O_DIRECT
To: Ankit Patel <ankitp at cdac.in>

Hello Ankit,

I just saw your mail.

I was getting that error because we werer using remap_pfn_range for
implementing a mmap but that incorrect in our case. We were supposed to use
vma no page for implementing mmap.

Here is the link which explains the same..

http://www.ussg.iu.edu/hypermail/linux/kernel/0010.2/0420.html

hope this helps..

-Manisha

 On 5/11/07, Ankit Patel <ankitp at cdac.in> wrote:
>
>  Hello Manisha,
>
> This has reference to ur below mail on linuxcprogramming at lists.linux.org.au
>
> **
> I need ur urgent help.. I am facing same problem.. I tried to find
> solution but still not got it...
>
> Please let me know how u had solved the problem...
>
> Its very urgent...Please...
>
>
> Regards,
> Ankit Patel
> C-DAC,Pune
> **
> **
> *Manisha Maheshwari* maheshwari.manisha at gmail.com
> <linuxcprogramming%40lists.linux.org.au?Subject=%5BLCP%5DProblem%20reading%20file%20with%20O_DIRECT&In-Reply-To=>
> *Thu Jul 6 07:18:04 UTC 2006*
>
>
>    - *Messages sorted by:* [ date ]<http://lists.linux.org.au/archives/linuxcprogramming/2006-July/date.html#1132> [
>    thread ]<http://lists.linux.org.au/archives/linuxcprogramming/2006-July/thread.html#1132> [
>    subject ]<http://lists.linux.org.au/archives/linuxcprogramming/2006-July/subject.html#1132> [
>    author ]<http://lists.linux.org.au/archives/linuxcprogramming/2006-July/author.html#1132>
>
>  ------------------------------
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/linuxcprogramming/attachments/20070603/7a4f22ee/attachment.htm 


More information about the linuxCprogramming mailing list