Bug 130373 (IT_48101)
Summary: | LTP read02 test case hangs when tmpfs is in use | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Howard Owen <howen> | ||||||||
Component: | kernel | Assignee: | Alexander Viro <aviro> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | Brian Brock <bbrock> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 3.0 | CC: | jneedle, petrides, riel, tao | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | i686 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2004-12-20 20:55:56 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: | 123574 | ||||||||||
Attachments: |
|
Description
Howard Owen
2004-08-19 18:32:15 UTC
Created attachment 102892 [details]
Program hangs on read(2) call
Program inlines the LTP test case
"ltp-full-20040804/testcases/kernel/syscalls/read/read02.c"
If run on a system where /tmp is mounted as tmpfs, the process will hang in 'R'
state.
Created attachment 103008 [details]
changes to shmem.c
A quick look with crash shows the tmpfs test is spinning in
do_shmem_file_read(). The loop logic is a bit different from
do_generic_file_read(). For the case that is properly returning an
error, do_generic_file_read() has the following logic:
ret = actor(desc, page, offset, nr);
...
if (ret == nr && desc->count)
continue;
break;
For the broken tmpfs case that spins, the logic is:
while (nr && desc->count) {
...
nr = file_read_actor(desc, page, offset, nr);
Simply changing this to be more like the do_generic_file_read()logic
resolved the hang problem.
while (nr == ret && desc->count) {
...
ret = file_read_actor(desc, page, offset, nr);
Diffs of the test changes attached.
Created attachment 103274 [details]
Patch for do_shmem_file_read loop problems
It appears that this problem has already been resolved in later 2.4 kernels.
The attached patch file represents the changes to the loop logic found in
2.4.26. This is just the bare essential changes needed to resolve the spinning
problem, but there are other changes to do_shmem_file_read() in the later
kernels that are probably worth picking up.
I just confirmed that RHL 9 with 2.4.20-31.9 doesn't have this problem by mistake :). It looks like something similar to the patch in comment 3 was already applied. A fix for this problem has just been committed to the RHEL3 U4 patch pool this evening (in kernel version 2.4.21-20.11.EL). A fix to the prior fix has just been committed to the RHEL3 U4 patch pool this evening (in kernel version 2.4.21-20.12.EL). An errata 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/RHBA-2004-550.html |