Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (34 commits)
  nfsd race fixes: jfs
  nfsd race fixes: reiserfs
  nfsd race fixes: ext4
  nfsd race fixes: ext3
  nfsd race fixes: ext2
  nfsd/create race fixes, infrastructure
  filesystem notification: create fs/notify to contain all fs notification
  fs/block_dev.c: __read_mostly improvement and sb_is_blkdev_sb utilization
  kill ->dir_notify()
  filp_cachep can be static in fs/file_table.c
  fix f_count description in Documentation/filesystems/files.txt
  make INIT_FS use the __RW_LOCK_UNLOCKED initialization
  take init_fs to saner place
  kill vfs_permission
  pass a struct path * to may_open
  kill walk_init_root
  remove incorrect comment in inode_permission
  expand some comments (d_path / seq_path)
  correct wrong function name of d_put in kernel document and source comment
  fix switch_names() breakage in short-to-short case
  ...
  • Loading branch information
Linus Torvalds committed Dec 31, 2008
2 parents db200df + 1f3403f commit b58602a
Showing 81 changed files with 696 additions and 351 deletions.
2 changes: 0 additions & 2 deletions Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
@@ -394,7 +394,6 @@ prototypes:
unsigned long (*get_unmapped_area)(struct file *, unsigned long,
unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
int (*dir_notify)(struct file *, unsigned long);
};

locking rules:
@@ -424,7 +423,6 @@ sendfile: no
sendpage: no
get_unmapped_area: no
check_flags: no
dir_notify: no

->llseek() locking has moved from llseek to the individual llseek
implementations. If your fs is not using generic_file_llseek, you
6 changes: 3 additions & 3 deletions Documentation/filesystems/files.txt
Original file line number Diff line number Diff line change
@@ -76,13 +76,13 @@ the fdtable structure -
5. Handling of the file structures is special. Since the look-up
of the fd (fget()/fget_light()) are lock-free, it is possible
that look-up may race with the last put() operation on the
file structure. This is avoided using atomic_inc_not_zero()
file structure. This is avoided using atomic_long_inc_not_zero()
on ->f_count :

rcu_read_lock();
file = fcheck_files(files, fd);
if (file) {
if (atomic_inc_not_zero(&file->f_count))
if (atomic_long_inc_not_zero(&file->f_count))
*fput_needed = 1;
else
/* Didn't get the reference, someone's freed */
@@ -92,7 +92,7 @@ the fdtable structure -
....
return file;

atomic_inc_not_zero() detects if refcounts is already zero or
atomic_long_inc_not_zero() detects if refcounts is already zero or
goes to zero during increment. If it does, we fail
fget()/fget_light().

5 changes: 1 addition & 4 deletions Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
@@ -733,7 +733,6 @@ struct file_operations {
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
int (*dir_notify)(struct file *filp, unsigned long arg);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, struct pipe_inode_info *, size_t, unsigned int);
@@ -800,8 +799,6 @@ otherwise noted.

check_flags: called by the fcntl(2) system call for F_SETFL command

dir_notify: called by the fcntl(2) system call for F_NOTIFY command

flock: called by the flock(2) system call

splice_write: called by the VFS to splice data from a pipe to a file. This
@@ -931,7 +928,7 @@ manipulate dentries:
d_lookup: look up a dentry given its parent and path name component
It looks up the child of that given name from the dcache
hash table. If it is found, the reference count is incremented
and the dentry is returned. The caller must use d_put()
and the dentry is returned. The caller must use dput()
to free the dentry when it finishes using it.

For further information on dentry locking, please refer to the document
1 change: 0 additions & 1 deletion arch/alpha/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
#include <asm/uaccess.h>


static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/arm/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@

#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/avr32/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@

#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/blackfin/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -33,7 +33,6 @@
#include <linux/mqueue.h>
#include <linux/fs.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);

1 change: 0 additions & 1 deletion arch/cris/kernel/process.c
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
* setup.
*/

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/frv/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
#include <asm/pgtable.h>


static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/h8300/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/ia64/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/m32r/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/m68k/kernel/process.c
Original file line number Diff line number Diff line change
@@ -40,7 +40,6 @@
* alignment requirements and potentially different initial
* setup.
*/
static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/m68knommu/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/mips/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/mn10300/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/parisc/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@
#include <asm/pgtable.h>
#include <asm/pgalloc.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/powerpc/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
#include <linux/mqueue.h>
#include <asm/uaccess.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
2 changes: 1 addition & 1 deletion arch/powerpc/oprofile/cell/spu_task_sync.c
Original file line number Diff line number Diff line change
@@ -297,7 +297,7 @@ static inline unsigned long fast_get_dcookie(struct path *path)
{
unsigned long cookie;

if (path->dentry->d_cookie)
if (path->dentry->d_flags & DCACHE_COOKIE)
return (unsigned long)path->dentry;
get_dcookie(path, &cookie);
return cookie;
1 change: 0 additions & 1 deletion arch/s390/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/sh/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@
#include <asm/uaccess.h>
#include <asm/pgtable.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct pt_regs fake_swapper_regs;
1 change: 0 additions & 1 deletion arch/sparc/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
#include <asm/pgtable.h>
#include <asm/uaccess.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/um/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
#include "linux/mqueue.h"
#include "asm/uaccess.h"

static struct fs_struct init_fs = INIT_FS;
struct mm_struct init_mm = INIT_MM(init_mm);
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
1 change: 0 additions & 1 deletion arch/x86/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@
#include <asm/pgtable.h>
#include <asm/desc.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
1 change: 0 additions & 1 deletion arch/xtensa/kernel/init_task.c
Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@

#include <asm/uaccess.h>

static struct fs_struct init_fs = INIT_FS;
static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
struct mm_struct init_mm = INIT_MM(init_mm);
2 changes: 1 addition & 1 deletion drivers/oprofile/buffer_sync.c
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ static inline unsigned long fast_get_dcookie(struct path *path)
{
unsigned long cookie;

if (path->dentry->d_cookie)
if (path->dentry->d_flags & DCACHE_COOKIE)
return (unsigned long)path->dentry;
get_dcookie(path, &cookie);
return cookie;
39 changes: 1 addition & 38 deletions fs/Kconfig
Original file line number Diff line number Diff line change
@@ -270,44 +270,7 @@ config OCFS2_COMPAT_JBD

endif # BLOCK

config DNOTIFY
bool "Dnotify support"
default y
help
Dnotify is a directory-based per-fd file change notification system
that uses signals to communicate events to user-space. There exist
superior alternatives, but some applications may still rely on
dnotify.

If unsure, say Y.

config INOTIFY
bool "Inotify file change notification support"
default y
---help---
Say Y here to enable inotify support. Inotify is a file change
notification system and a replacement for dnotify. Inotify fixes
numerous shortcomings in dnotify and introduces several new features
including multiple file events, one-shot support, and unmount
notification.

For more information, see <file:Documentation/filesystems/inotify.txt>

If unsure, say Y.

config INOTIFY_USER
bool "Inotify support for userspace"
depends on INOTIFY
default y
---help---
Say Y here to enable inotify support for userspace, including the
associated system calls. Inotify allows monitoring of both files and
directories via a single open fd. Events are read from the file
descriptor, which is also select()- and poll()-able.

For more information, see <file:Documentation/filesystems/inotify.txt>

If unsure, say Y.
source "fs/notify/Kconfig"

config QUOTA
bool "Quota support"
5 changes: 1 addition & 4 deletions fs/Makefile
Original file line number Diff line number Diff line change
@@ -20,8 +20,7 @@ obj-y += no-block.o
endif

obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o
obj-$(CONFIG_INOTIFY) += inotify.o
obj-$(CONFIG_INOTIFY_USER) += inotify_user.o
obj-y += notify/
obj-$(CONFIG_EPOLL) += eventpoll.o
obj-$(CONFIG_ANON_INODES) += anon_inodes.o
obj-$(CONFIG_SIGNALFD) += signalfd.o
@@ -57,8 +56,6 @@ obj-$(CONFIG_QFMT_V1) += quota_v1.o
obj-$(CONFIG_QFMT_V2) += quota_v2.o
obj-$(CONFIG_QUOTACTL) += quota.o

obj-$(CONFIG_DNOTIFY) += dnotify.o

obj-$(CONFIG_PROC_FS) += proc/
obj-y += partitions/
obj-$(CONFIG_SYSFS) += sysfs/
6 changes: 0 additions & 6 deletions fs/bad_inode.c
Original file line number Diff line number Diff line change
@@ -132,11 +132,6 @@ static int bad_file_check_flags(int flags)
return -EIO;
}

static int bad_file_dir_notify(struct file *file, unsigned long arg)
{
return -EIO;
}

static int bad_file_flock(struct file *filp, int cmd, struct file_lock *fl)
{
return -EIO;
@@ -179,7 +174,6 @@ static const struct file_operations bad_file_ops =
.sendpage = bad_file_sendpage,
.get_unmapped_area = bad_file_get_unmapped_area,
.check_flags = bad_file_check_flags,
.dir_notify = bad_file_dir_notify,
.flock = bad_file_flock,
.splice_write = bad_file_splice_write,
.splice_read = bad_file_splice_read,
5 changes: 4 additions & 1 deletion fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
@@ -378,7 +378,8 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino)
inode->i_size = 0;
inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE;
strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink,
BEFS_SYMLINK_LEN);
BEFS_SYMLINK_LEN - 1);
befs_ino->i_data.symlink[BEFS_SYMLINK_LEN - 1] = '\0';
} else {
int num_blks;

@@ -477,6 +478,8 @@ befs_follow_link(struct dentry *dentry, struct nameidata *nd)
kfree(link);
befs_error(sb, "Failed to read entire long symlink");
link = ERR_PTR(-EIO);
} else {
link[len - 1] = '\0';
}
} else {
link = befs_ino->i_data.symlink;
9 changes: 5 additions & 4 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
@@ -326,12 +326,13 @@ static struct file_system_type bd_type = {
.kill_sb = kill_anon_super,
};

static struct vfsmount *bd_mnt __read_mostly;
struct super_block *blockdev_superblock;
struct super_block *blockdev_superblock __read_mostly;

void __init bdev_cache_init(void)
{
int err;
struct vfsmount *bd_mnt;

bdev_cachep = kmem_cache_create("bdev_cache", sizeof(struct bdev_inode),
0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT|
SLAB_MEM_SPREAD|SLAB_PANIC),
@@ -373,7 +374,7 @@ struct block_device *bdget(dev_t dev)
struct block_device *bdev;
struct inode *inode;

inode = iget5_locked(bd_mnt->mnt_sb, hash(dev),
inode = iget5_locked(blockdev_superblock, hash(dev),
bdev_test, bdev_set, &dev);

if (!inode)
@@ -463,7 +464,7 @@ void bd_forget(struct inode *inode)

spin_lock(&bdev_lock);
if (inode->i_bdev) {
if (inode->i_sb != blockdev_superblock)
if (!sb_is_blkdev_sb(inode->i_sb))
bdev = inode->i_bdev;
__bd_forget(inode);
}
2 changes: 1 addition & 1 deletion fs/cifs/Makefile
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ obj-$(CONFIG_CIFS) += cifs.o

cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \
md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o \
md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \
readdir.o ioctl.o sess.o export.o cifsacl.o

cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
Loading

0 comments on commit b58602a

Please sign in to comment.