]> err.no Git - linux-2.6/commitdiff
fs: correct SuS compliance for open of large file without options
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Wed, 17 Oct 2007 06:30:22 +0000 (23:30 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:43:01 +0000 (08:43 -0700)
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>
fs/gfs2/ops_file.c
fs/ntfs/file.c
fs/open.c

index 7eb4b280ac665f43db21b0d646beda04fb5b8357..bb11fd6752d3d47e0f50eaeae330e2ecad391f1b 100644 (file)
@@ -406,7 +406,7 @@ static int gfs2_open(struct inode *inode, struct file *file)
 
                if (!(file->f_flags & O_LARGEFILE) &&
                    ip->i_di.di_size > MAX_NON_LFS) {
-                       error = -EFBIG;
+                       error = -EOVERFLOW;
                        goto fail_gunlock;
                }
 
index c814204d4ea0d8ab6533ebd2c59d0b626669bc61..6cd08dfdc2ed17afcacb1985e2c444910f18e4dd 100644 (file)
@@ -61,7 +61,7 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
 {
        if (sizeof(unsigned long) < 8) {
                if (i_size_read(vi) > MAX_LFS_FILESIZE)
-                       return -EFBIG;
+                       return -EOVERFLOW;
        }
        return generic_file_open(vi, filp);
 }
index 044bfa891c94c5e0d8330eea20893bf0ffffbd55..cdbb94a9efc20ceb3c07c52419b73b124859f7e6 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -1177,7 +1177,7 @@ asmlinkage long sys_vhangup(void)
 int generic_file_open(struct inode * inode, struct file * filp)
 {
        if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
-               return -EFBIG;
+               return -EOVERFLOW;
        return 0;
 }