Bug 7253

Summary: Open of large file on 32-bit fails with EFBIG, should be EOVERFLOW
Product: File System Reporter: Michael Kerrisk (michael.kerrisk)
Component: VFSAssignee: Alan (alan)
Status: CLOSED CODE_FIX    
Severity: normal CC: cw, protasnb, rdunlap
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.18 Subsystem:
Regression: --- Bisected commit-id:

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

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

[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)