Bug 20293 - RH 7.0 Enterprise breaks pread() semantics
Summary: RH 7.0 Enterprise breaks pread() semantics
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Michael K. Johnson
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-03 19:10 UTC by John Kohl
Modified: 2007-04-18 16:29 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-15 03:18:43 UTC
Embargoed:


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

Description John Kohl 2000-11-03 19:10:12 UTC
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 19:12:04 UTC
Created attachment 5016 [details]
a program that demonstrates the bug

Comment 2 John Kohl 2002-12-16 14:56:06 UTC
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 15:10:21 UTC
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.