Description of problem: When issuing AIO reads to a file opened with O_DIRECT, the "bytes read" returned for the last block in the file is wrong. If the user specified a 4k read, and the file only has 300 bytes left, the kernel will return that it read 4k! Version-Release number of selected component (if applicable): kernel-2.6.9-27.EL How reproducible: 100% Steps to Reproduce: Build the attached file like so: gcc -o dioeof dioeof.c -laio Then, create a file name a.txt with dd: dd if=/dev/zero of=a.txt bs=300 count=1 Take note of the blocksize and count, here. Now, run the program in the same directory as a.txt. Actual results: ./dioeof ret = 300 ret = 4096 Expected results: ret = 300 ret = 300 Additional info:
Created attachment 123323 [details] reproducer
Created attachment 123326 [details] Fix the return value for the last read of a file that is not a multple of block size this patch is currently untested.
hmmm...changing the dio structure is likely a kabi issue.
How so? The structure definition is private to fs/direct-io.c.
ok. you're right. i retract my comment
committed in stream U4 build 34.6. A test kernel with this patch is available from http://people.redhat.com/~jbaron/rhel4/
Is there any schedule on releasing kernel with this bugfix?
It will be available in update 4.
I'm really suprised, that this patch was not included in https://rhn.redhat.com/errata/RHSA-2006-0493.html I do consider this a security issue, as use is allowed to read data, which He has not wrote itself. For eg. what would happen if that filesystem clusted was previously used for /etc/shadow? Anyway - where can I find some schedule for RH releases (so I can know when it could be released)?
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2006-0575.html