Bug 456453
Summary: | GFS2: d_rwdirectempty fails with short read | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Nate Straz <nstraz> | ||||||
Component: | kernel | Assignee: | Ben Marzinski <bmarzins> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Martin Jenner <mjenner> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 5.3 | CC: | bstevens, edamato, lwang, swhiteho | ||||||
Target Milestone: | beta | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2009-01-20 20:08:23 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: | |||||||||
Attachments: |
|
Description
Nate Straz
2008-07-23 19:30:56 UTC
The problem is that the vfs code does a check to see if the position of a direct_io read is past the end of a file in __generic_file_aio_read(). If it is, then it never calls generic_file_direct_IO(), which is what hooks into the gfs2 directio read code. This check is useful for local filesystems, but since gfs2 doesn't have a lock on the file, there's no guarantee that the file size will be correct for gfs2. This won't be a problem for gfs, since it grabs the locks at an earlier stage of the system call. Created attachment 312687 [details]
patch that fixes the short reads
This patch applies on top of the 2.6.18-98.el5 RHEL5 kernel. It adds another
inode flag, S_NOSIZECHK, that skips the test of whether the read position is
past the end of the file. GFS2 sets this on all of its inodes, so that this
check is skipped.
I have been totally unable to recreate this issue on the upstream 2.6.26 kernel. However I can't see any reason why it should be any different. Created attachment 314123 [details]
Port of upstream fix.
My last patch only dealt with the directio case. This happens for cached reads too. However, this problem is fixed by already existing patch in the upstream kernel. So this is a port of that patch.
in kernel-2.6.18-107.el5 You can download this test kernel from http://people.redhat.com/dzickus/el5 Verified against kernel-2.6.18-122.el5. 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 therefore 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-2009-0225.html |