LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   error using O_DIRECT starting with kernel 3.16.0 (?) (https://www.linuxquestions.org/questions/linux-software-2/error-using-o_direct-starting-with-kernel-3-16-0-a-4175521752/)

kornelix 10-11-2014 01:32 AM

error using O_DIRECT starting with kernel 3.16.0 (?)
 
I have a program that uses the following open() flags:
Code:

O_RDONLY+O_NOATIME+O_LARGEFILE+O_DIRECT
read() calls work OK until EOF is reached and then an EINVAL error is returned.

The buffer is aligned with the following call:
Code:

posix_memalign((void**) &vbuff,512,BIOCC);
The program runs OK if O_DIRECT is removed.
The program has been running for years on earlier kernel versions.

Is this a bug or an API change? Need guidance.

O_DIRECT is used because the file is being read to verify integrity shortly after it was written, so reading from the cache is not wanted.
This is part of a backup utility.


All times are GMT -5. The time now is 06:03 AM.