Commit a9c62a18a291499d15a370d08771e781fbaf91e6

Authored by Alan Cox
Committed by Linus Torvalds
1 parent 28e3fed8b7

fs: correct SuS compliance for open of large file without options

The early LFS work that Linux uses favours EFBIG in various places. SuSv3
specifically uses EOVERFLOW for this as noted by Michael (Bug 7253)

[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. We should therefore
transition to the proper error return code

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Theodore Tso <tytso@mit.edu>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 3 changed files with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -406,7 +406,7 @@
406 406  
407 407 if (!(file->f_flags & O_LARGEFILE) &&
408 408 ip->i_di.di_size > MAX_NON_LFS) {
409   - error = -EFBIG;
  409 + error = -EOVERFLOW;
410 410 goto fail_gunlock;
411 411 }
412 412  
... ... @@ -61,7 +61,7 @@
61 61 {
62 62 if (sizeof(unsigned long) < 8) {
63 63 if (i_size_read(vi) > MAX_LFS_FILESIZE)
64   - return -EFBIG;
  64 + return -EOVERFLOW;
65 65 }
66 66 return generic_file_open(vi, filp);
67 67 }
... ... @@ -1177,7 +1177,7 @@
1177 1177 int generic_file_open(struct inode * inode, struct file * filp)
1178 1178 {
1179 1179 if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
1180   - return -EFBIG;
  1180 + return -EOVERFLOW;
1181 1181 return 0;
1182 1182 }
1183 1183