Skip to content

Commit 8fe74cf

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: Remove two unneeded exports and make two symbols static in fs/mpage.c Cleanup after commit 585d3bc Trim includes of fdtable.h Don't crap into descriptor table in binfmt_som Trim includes in binfmt_elf Don't mess with descriptor table in load_elf_binary() Get rid of indirect include of fs_struct.h New helper - current_umask() check_unsafe_exec() doesn't care about signal handlers sharing New locking/refcounting for fs_struct Take fs_struct handling to new file (fs/fs_struct.c) Get rid of bumping fs_struct refcount in pivot_root(2) Kill unsharing fs_struct in __set_personality()
2 parents c2eb2fa + ced117c commit 8fe74cf

57 files changed

Lines changed: 337 additions & 268 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎arch/cris/kernel/process.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <asm/system.h>
2020
#include <linux/module.h>
2121
#include <linux/spinlock.h>
22-
#include <linux/fs_struct.h>
2322
#include <linux/init_task.h>
2423
#include <linux/sched.h>
2524
#include <linux/fs.h>

‎arch/powerpc/platforms/cell/spufs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
635635
if (dentry->d_inode)
636636
goto out_dput;
637637

638-
mode &= ~current->fs->umask;
638+
mode &= ~current_umask();
639639

640640
if (flags & SPU_CREATE_GANG)
641641
ret = spufs_create_gang(nd->path.dentry->d_inode,

‎drivers/char/tty_audit.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
*/
1111

1212
#include <linux/audit.h>
13-
#include <linux/file.h>
14-
#include <linux/fdtable.h>
1513
#include <linux/tty.h>
1614

1715
struct tty_audit_buf {

‎drivers/char/tty_ldisc.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/tty_flip.h>
1111
#include <linux/devpts_fs.h>
1212
#include <linux/file.h>
13-
#include <linux/fdtable.h>
1413
#include <linux/console.h>
1514
#include <linux/timer.h>
1615
#include <linux/ctype.h>

‎fs/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ obj-y := open.o read_write.o file_table.o super.o \
1111
attr.o bad_inode.o file.o filesystems.o namespace.o \
1212
seq_file.o xattr.o libfs.o fs-writeback.o \
1313
pnode.o drop_caches.o splice.o sync.o utimes.o \
14-
stack.o
14+
stack.o fs_struct.o
1515

1616
ifeq ($(CONFIG_BLOCK),y)
1717
obj-y += buffer.o bio.o block_dev.o direct-io.o mpage.o ioprio.o

‎fs/binfmt_elf.c‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,22 @@
1212
#include <linux/module.h>
1313
#include <linux/kernel.h>
1414
#include <linux/fs.h>
15-
#include <linux/stat.h>
16-
#include <linux/time.h>
1715
#include <linux/mm.h>
1816
#include <linux/mman.h>
1917
#include <linux/errno.h>
2018
#include <linux/signal.h>
2119
#include <linux/binfmts.h>
2220
#include <linux/string.h>
2321
#include <linux/file.h>
24-
#include <linux/fcntl.h>
25-
#include <linux/ptrace.h>
2622
#include <linux/slab.h>
27-
#include <linux/shm.h>
2823
#include <linux/personality.h>
2924
#include <linux/elfcore.h>
3025
#include <linux/init.h>
3126
#include <linux/highuid.h>
32-
#include <linux/smp.h>
3327
#include <linux/compiler.h>
3428
#include <linux/highmem.h>
3529
#include <linux/pagemap.h>
3630
#include <linux/security.h>
37-
#include <linux/syscalls.h>
3831
#include <linux/random.h>
3932
#include <linux/elf.h>
4033
#include <linux/utsname.h>
@@ -576,7 +569,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
576569
unsigned long error;
577570
struct elf_phdr *elf_ppnt, *elf_phdata;
578571
unsigned long elf_bss, elf_brk;
579-
int elf_exec_fileno;
580572
int retval, i;
581573
unsigned int size;
582574
unsigned long elf_entry;
@@ -631,12 +623,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
631623
goto out_free_ph;
632624
}
633625

634-
retval = get_unused_fd();
635-
if (retval < 0)
636-
goto out_free_ph;
637-
get_file(bprm->file);
638-
fd_install(elf_exec_fileno = retval, bprm->file);
639-
640626
elf_ppnt = elf_phdata;
641627
elf_bss = 0;
642628
elf_brk = 0;
@@ -655,13 +641,13 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
655641
retval = -ENOEXEC;
656642
if (elf_ppnt->p_filesz > PATH_MAX ||
657643
elf_ppnt->p_filesz < 2)
658-
goto out_free_file;
644+
goto out_free_ph;
659645

660646
retval = -ENOMEM;
661647
elf_interpreter = kmalloc(elf_ppnt->p_filesz,
662648
GFP_KERNEL);
663649
if (!elf_interpreter)
664-
goto out_free_file;
650+
goto out_free_ph;
665651

666652
retval = kernel_read(bprm->file, elf_ppnt->p_offset,
667653
elf_interpreter,
@@ -956,8 +942,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
956942

957943
kfree(elf_phdata);
958944

959-
sys_close(elf_exec_fileno);
960-
961945
set_binfmt(&elf_format);
962946

963947
#ifdef ARCH_HAS_SETUP_ADDITIONAL_PAGES
@@ -1028,8 +1012,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
10281012
fput(interpreter);
10291013
out_free_interp:
10301014
kfree(elf_interpreter);
1031-
out_free_file:
1032-
sys_close(elf_exec_fileno);
10331015
out_free_ph:
10341016
kfree(elf_phdata);
10351017
goto out;

‎fs/binfmt_som.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ static int map_som_binary(struct file *file,
188188
static int
189189
load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
190190
{
191-
int som_exec_fileno;
192191
int retval;
193192
unsigned int size;
194193
unsigned long som_entry;
@@ -220,12 +219,6 @@ load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
220219
goto out_free;
221220
}
222221

223-
retval = get_unused_fd();
224-
if (retval < 0)
225-
goto out_free;
226-
get_file(bprm->file);
227-
fd_install(som_exec_fileno = retval, bprm->file);
228-
229222
/* Flush all traces of the currently running executable */
230223
retval = flush_old_exec(bprm);
231224
if (retval)

‎fs/block_dev.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ int fsync_bdev(struct block_device *bdev)
204204
}
205205
return sync_blockdev(bdev);
206206
}
207+
EXPORT_SYMBOL(fsync_bdev);
207208

208209
/**
209210
* freeze_bdev -- lock a filesystem and force it into a consistent state

‎fs/btrfs/acl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ int btrfs_init_acl(struct inode *inode, struct inode *dir)
256256
}
257257

258258
if (!acl)
259-
inode->i_mode &= ~current->fs->umask;
259+
inode->i_mode &= ~current_umask();
260260
}
261261

262262
if (IS_POSIXACL(dir) && acl) {

‎fs/btrfs/ioctl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static noinline int btrfs_mksubvol(struct path *parent, char *name,
267267
goto out_dput;
268268

269269
if (!IS_POSIXACL(parent->dentry->d_inode))
270-
mode &= ~current->fs->umask;
270+
mode &= ~current_umask();
271271

272272
error = mnt_want_write(parent->mnt);
273273
if (error)

0 commit comments

Comments
 (0)