Bug 7253 - Open of large file on 32-bit fails with EFBIG, should be EOVERFLOW
Summary: Open of large file on 32-bit fails with EFBIG, should be EOVERFLOW
Alias: None
Product: File System
Classification: Unclassified
Component: VFS (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Alan
Depends on:
Reported: 2006-10-03 01:32 UTC by Michael Kerrisk
Modified: 2008-09-14 06:47 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.18
Tree: Mainline
Regression: ---


Description Michael Kerrisk 2006-10-03 01:32:15 UTC
Most recent kernel where this bug did not occur: all kernets have this bug
Hardware Environment: x86 (and probably other 32-bit arches)
Software Environment: 
Problem Description:

In the SUSv3 specification of open(), the following error is 

[EOVERFLOW] The named file is a regular file and the size of the 
file cannot be represented correctly in an object of type off_t.

However, on most Linux file systems if an application tries, on a 
32-bit architecture, to open a file of size greater than 2 GB 
without specifying O_LARGEFILE (or without being compiled with 
-D_FILE_OFFSET_BITS=64), then the resulting error is EFBIG.  
It should be EOVERFLOW, as far as I can see.

The EFBIG error occurs on ext2, ext3, XFS, and JFS.

In this scenario, no error is returned from the open() on Reiserfs.  
I am not sure whether this is a (different) bug or not.  (I suspect it 
is a separate bug.)

Steps to reproduce:
Comment 1 Alan 2007-09-27 06:20:59 UTC
EFBIG comes from the LFS spec which is older.

Patch posted
Comment 2 Michael Kerrisk 2008-09-14 06:47:16 UTC
Just for completeness, I note that the patch went into 2.6.24 (and I'll update the man page)

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