linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: Correct SuS compliance for open of large file without options
@ 2007-09-27 13:29 Alan Cox
  2007-09-27 14:01 ` Arjan van de Ven
  0 siblings, 1 reply; 21+ messages in thread
From: Alan Cox @ 2007-09-27 13:29 UTC (permalink / raw)
  To: akpm, linux-kernel, linux-fsdevel

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>

diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.23rc8-mm1/fs/gfs2/ops_file.c linux-2.6.23rc8-mm1/fs/gfs2/ops_file.c
--- linux.vanilla-2.6.23rc8-mm1/fs/gfs2/ops_file.c	2007-09-26 16:46:54.000000000 +0100
+++ linux-2.6.23rc8-mm1/fs/gfs2/ops_file.c	2007-09-27 13:45:48.000000000 +0100
@@ -406,7 +406,7 @@
 
 		if (!(file->f_flags & O_LARGEFILE) &&
 		    ip->i_di.di_size > MAX_NON_LFS) {
-			error = -EFBIG;
+			error = -EOVERFLOW;
 			goto fail_gunlock;
 		}
 
diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.23rc8-mm1/fs/ntfs/file.c linux-2.6.23rc8-mm1/fs/ntfs/file.c
--- linux.vanilla-2.6.23rc8-mm1/fs/ntfs/file.c	2007-09-26 16:46:55.000000000 +0100
+++ linux-2.6.23rc8-mm1/fs/ntfs/file.c	2007-09-27 13:47:35.000000000 +0100
@@ -61,7 +61,7 @@
 {
 	if (sizeof(unsigned long) < 8) {
 		if (i_size_read(vi) > MAX_LFS_FILESIZE)
-			return -EFBIG;
+			return -EOVERFLOW;
 	}
 	return generic_file_open(vi, filp);
 }
diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.23rc8-mm1/fs/open.c linux-2.6.23rc8-mm1/fs/open.c
--- linux.vanilla-2.6.23rc8-mm1/fs/open.c	2007-09-26 16:46:55.000000000 +0100
+++ linux-2.6.23rc8-mm1/fs/open.c	2007-09-27 13:45:10.000000000 +0100
@@ -1210,7 +1210,7 @@
 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;
 }
 


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2007-09-28  3:25 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-27 13:29 [PATCH] fs: Correct SuS compliance for open of large file without options Alan Cox
2007-09-27 14:01 ` Arjan van de Ven
2007-09-27 14:19   ` Alan Cox
2007-09-27 14:35     ` Jens Axboe
2007-09-27 14:44       ` Alan Cox
2007-09-27 15:08         ` Jens Axboe
2007-09-27 15:19           ` Alan Cox
2007-09-27 15:59             ` Theodore Tso
2007-09-27 17:23               ` Andrew Morton
2007-09-27 17:59                 ` Greg KH
2007-09-27 18:37                   ` Theodore Tso
2007-09-27 18:45                     ` Matthew Wilcox
2007-09-27 21:34                     ` Greg KH
2007-09-27 22:27                       ` Kyle Moffett
2007-09-27 23:11                         ` Greg KH
2007-09-27 23:19                       ` Theodore Tso
2007-09-27 23:28                         ` Matthew Wilcox
     [not found]                         ` <20070927232857.GA12049@parisc-linux.org>
2007-09-28  2:21                           ` Theodore Tso
2007-09-28  3:22                           ` Greg KH
2007-09-28  3:21                         ` Greg KH
2007-09-27 23:41               ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).