Bug 178720

Summary: O_DIRECT bug when reading last block of sparse file
Product: Red Hat Enterprise Linux 4 Reporter: Jeff Moyer <jmoyer>
Component: kernelAssignee: Jeff Moyer <jmoyer>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: jbaron, rkenna, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2006-0575 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-10 21:55:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 181409    
Attachments:
Description Flags
test program to reproduce a short O_DIRECT read of the last block in a sparse file
none
patch proposed upstream to fix this problem none

Description Jeff Moyer 2006-01-23 19:20:09 UTC
+++ 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 Jeff Moyer 2006-01-23 19:20:09 UTC
Created attachment 123587 [details]
test program to reproduce a short O_DIRECT read of the last block in a sparse file

Comment 3 Jeff Moyer 2006-01-23 20:35:37 UTC
Created attachment 123592 [details]
patch proposed upstream to fix this problem

Comment 6 Jason Baron 2006-03-22 15:04:18 UTC
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 22:06:47 UTC
[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 21:55:26 UTC
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