Bug 20293 - RH 7.0 Enterprise breaks pread() semantics
RH 7.0 Enterprise breaks pread() semantics
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Michael K. Johnson
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2000-11-03 14:10 EST by John Kohl
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-12-14 22:18:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
a program that demonstrates the bug (1.35 KB, text/plain)
2000-11-03 14:12 EST, John Kohl
no flags Details

  None (edit)
Description John Kohl 2000-11-03 14:10:12 EST
The 2.2.16-lfs kernel patch breaks pread() semantics.
When the offset lies beyond
end-of-file, standards (SuS V2) say it shall return 0 bytes, but with
the patch it returns EOVERFLOW.

The bug is in the patch to sys_pread(), these lines:

+	/* Read starting from beyond the end of file ? */
+	if (inode->i_size <= pos) {
+	  ret = -EOVERFLOW;
+	  goto out;
+	}

This should return zero rather than an error.  You might argue that if
pos is beyond the 32-bit offset limit that it should return an error,
but if it is not beyond this limit it must return zero.
Comment 1 John Kohl 2000-11-03 14:12:04 EST
Created attachment 5016 [details]
a program that demonstrates the bug
Comment 2 John Kohl 2002-12-16 09:56:06 EST
Would you kindly explain why you have closed this as not a bug?
Did it get fixed in a future release?  Is there a superceding standard
which does not require the behavior as I quoted from Single Unix Spec v2?
Comment 3 Alan Cox 2002-12-16 10:10:21 EST
Sorry I meant to close it as 'WONTFIX' - I missed the button.

In the 2.2 tree it is WONTFIX as we won't be making non critical changes to the
2.2 tree. In Linux 2.4 we seem to pass the test suite and inspection of the code
agrees the problem is gone.

As regards standards SuS V3 replaces V2 but I don't believe it changed anything

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