Messages in this thread Patch in this message | | | Date | Sun, 4 Jul 2004 10:52:02 -0700 | From | William Lee Irwin III <> | Subject | Re: move O_LARGEFILE forcing to filp_open() |
| |
On Sonntag, 4. Juli 2004 19:38, William Lee Irwin III wrote: >> How does this look as an implementation of that suggestion, incremental >> to your compat_sys_open() consolidation patch?
On Sun, Jul 04, 2004 at 07:49:00PM +0200, Arnd Bergmann wrote: > At first sight, it looks like (filp->f_flags & O_LARGEFILE) will always > be true after calling filp_open, but I don't have time to look closer > today.
Quite right.
Index: mm5-2.6.7/fs/compat.c =================================================================== --- mm5-2.6.7.orig/fs/compat.c 2004-07-04 10:29:04.691152200 -0700 +++ mm5-2.6.7/fs/compat.c 2004-07-04 10:51:05.329384672 -0700 @@ -160,6 +160,12 @@ error = PTR_ERR(f); if (IS_ERR(f)) goto out_error; + if (!(flags & O_LARGEFILE) && + i_size_read(f->f_dentry->d_inode) > MAX_NON_LFS) { + error = -EFBIG; + filp_close(f, current->files); + goto out_error; + } fd_install(fd, f); } out: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |