Skip to content

Commit a9c62a1

Browse files
Alan-CoxLinus Torvalds
authored andcommitted
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 <[email protected]> Cc: Theodore Tso <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 28e3fed commit a9c62a1

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

fs/gfs2/ops_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static int gfs2_open(struct inode *inode, struct file *file)
406406

407407
if (!(file->f_flags & O_LARGEFILE) &&
408408
ip->i_di.di_size > MAX_NON_LFS) {
409-
error = -EFBIG;
409+
error = -EOVERFLOW;
410410
goto fail_gunlock;
411411
}
412412

fs/ntfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static int ntfs_file_open(struct inode *vi, struct file *filp)
6161
{
6262
if (sizeof(unsigned long) < 8) {
6363
if (i_size_read(vi) > MAX_LFS_FILESIZE)
64-
return -EFBIG;
64+
return -EOVERFLOW;
6565
}
6666
return generic_file_open(vi, filp);
6767
}

fs/open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1177,7 +1177,7 @@ asmlinkage long sys_vhangup(void)
11771177
int generic_file_open(struct inode * inode, struct file * filp)
11781178
{
11791179
if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
1180-
return -EFBIG;
1180+
return -EOVERFLOW;
11811181
return 0;
11821182
}
11831183

0 commit comments

Comments
 (0)