Bug 178720 - O_DIRECT bug when reading last block of sparse file
O_DIRECT bug when reading last block of sparse file
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeffrey Moyer
Brian Brock
:
Depends On:
Blocks: 181409
  Show dependency treegraph
 
Reported: 2006-01-23 14:20 EST by Jeffrey Moyer
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version: RHSA-2006-0575
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-10 17:55:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test program to reproduce a short O_DIRECT read of the last block in a sparse file (1.75 KB, text/x-csrc)
2006-01-23 14:20 EST, Jeffrey Moyer
no flags Details
patch proposed upstream to fix this problem (768 bytes, patch)
2006-01-23 15:35 EST, Jeffrey Moyer
no flags Details | Diff

  None (edit)
Description Jeffrey Moyer 2006-01-23 14:20:09 EST
+++ This bug was initially created as a clone of Bug #169243 +++

Escalated to Bugzilla from IssueTracker

When reading the last block of a sparse file opened with O_DIRECT, we get a
premature EOF instead of a short read.

Steps to reproduce:

# gcc -o directio directio.c
# ./directio foo

The output will look something like this without the patch:

creating test file of size 4097...done
performing test...
Read 4096 total bytes out of 4097.
Test Failed.

You will see a "success" indication when the patch is applied.

How reproducible?
Always.
Comment 1 Jeffrey Moyer 2006-01-23 14:20:09 EST
Created attachment 123587 [details]
test program to reproduce a short O_DIRECT read of the last block in a sparse file
Comment 3 Jeffrey Moyer 2006-01-23 15:35:37 EST
Created attachment 123592 [details]
patch proposed upstream to fix this problem
Comment 6 Jason Baron 2006-03-22 10:04:18 EST
committed in stream U4 build 34.6. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/
Comment 9 Mike Gahagan 2006-06-22 18:06:47 EDT
[mpg@belenus test]$ ./directio testfile
creating test file of size 4097...done
performing test...
Read 4096 total bytes out of 4097.
Test Failed.
[mpg@belenus test]$ uname -a
Linux belenus 2.6.9-34.EL #1 Fri Feb 24 16:44:51 EST 2006 i686 i686 i386 GNU/Linux

[root@dhcp59-204 178720]# ./directio64 test
creating test file of size 4097...done
performing test...
short read: 1 out of 4096 bytes
Read 4097 total bytes out of 4097.
Test Passed.
[root@dhcp59-204 178720]# ./directio test
creating test file of size 4097...done
performing test...
short read: 1 out of 4096 bytes
Read 4097 total bytes out of 4097.
Test Passed.
[root@dhcp59-204 178720]# uname -a
Linux dhcp59-204.rdu.redhat.com 2.6.9-39.EL #1 Thu Jun 1 17:47:54 EDT 2006
x86_64 x86_64 x86_64 GNU/Linux


looks good at least on x86_64 & x86
Comment 11 Red Hat Bugzilla 2006-08-10 17:55:26 EDT
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

Note You need to log in before you can comment on or make changes to this bug.