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

Pull vfs changes from Al Viro.
 "A lot of misc stuff.  The obvious groups:
   * Miklos' atomic_open series; kills the damn abuse of
     ->d_revalidate() by NFS, which was the major stumbling block for
     all work in that area.
   * ripping security_file_mmap() and dealing with deadlocks in the
     area; sanitizing the neighborhood of vm_mmap()/vm_munmap() in
     general.
   * ->encode_fh() switched to saner API; insane fake dentry in
     mm/cleancache.c gone.
   * assorted annotations in fs (endianness, __user)
   * parts of Artem's ->s_dirty work (jff2 and reiserfs parts)
   * ->update_time() work from Josef.
   * other bits and pieces all over the place.

  Normally it would've been in two or three pull requests, but
  signal.git stuff had eaten a lot of time during this cycle ;-/"

Fix up trivial conflicts in Documentation/filesystems/vfs.txt (the
'truncate_range' inode method was removed by the VM changes, the VFS
update adds an 'update_time()' method), and in fs/btrfs/ulist.[ch] (due
to sparse fix added twice, with other changes nearby).

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (95 commits)
  nfs: don't open in ->d_revalidate
  vfs: retry last component if opening stale dentry
  vfs: nameidata_to_filp(): don't throw away file on error
  vfs: nameidata_to_filp(): inline __dentry_open()
  vfs: do_dentry_open(): don't put filp
  vfs: split __dentry_open()
  vfs: do_last() common post lookup
  vfs: do_last(): add audit_inode before open
  vfs: do_last(): only return EISDIR for O_CREAT
  vfs: do_last(): check LOOKUP_DIRECTORY
  vfs: do_last(): make ENOENT exit RCU safe
  vfs: make follow_link check RCU safe
  vfs: do_last(): use inode variable
  vfs: do_last(): inline walk_component()
  vfs: do_last(): make exit RCU safe
  vfs: split do_lookup()
  Btrfs: move over to use ->update_time
  fs: introduce inode operation ->update_time
  reiserfs: get rid of resierfs_sync_super
  reiserfs: mark the superblock as dirty a bit later
  ...
  • Loading branch information
torvalds committed Jun 1, 2012
2 parents 4edebed + 0ef97dc commit 1193755
Show file tree
Hide file tree
Showing 148 changed files with 1,495 additions and 1,618 deletions.
3 changes: 3 additions & 0 deletions Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ ata *);
ssize_t (*listxattr) (struct dentry *, char *, size_t);
int (*removexattr) (struct dentry *, const char *);
int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
void (*update_time)(struct inode *, struct timespec *, int);

locking rules:
all may block
Expand All @@ -87,6 +88,8 @@ getxattr: no
listxattr: no
removexattr: yes
fiemap: no
update_time: no

Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
victim.
cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
Expand Down
4 changes: 4 additions & 0 deletions Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ struct inode_operations {
ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
ssize_t (*listxattr) (struct dentry *, char *, size_t);
int (*removexattr) (struct dentry *, const char *);
void (*update_time)(struct inode *, struct timespec *, int);
};

Again, all methods are called without any locks being held, unless
Expand Down Expand Up @@ -471,6 +472,9 @@ otherwise noted.
removexattr: called by the VFS to remove an extended attribute from
a file. This method is called by removexattr(2) system call.

update_time: called by the VFS to update a specific time or the i_version of
an inode. If this is not defined the VFS will update the inode itself
and call mark_inode_dirty_sync.

The Address Space Object
========================
Expand Down
3 changes: 0 additions & 3 deletions arch/alpha/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned int __kernel_ino_t;
#define __kernel_ino_t __kernel_ino_t

typedef unsigned int __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned long __kernel_sigset_t; /* at least 32 bits */

#include <asm-generic/posix_types.h>
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/avr32/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/blackfin/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned int __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/cris/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/frv/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/h8300/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/ia64/include/asm/posix_types.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef _ASM_IA64_POSIX_TYPES_H
#define _ASM_IA64_POSIX_TYPES_H

typedef unsigned int __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned long __kernel_sigset_t; /* at least 32 bits */

#include <asm-generic/posix_types.h>
Expand Down
10 changes: 2 additions & 8 deletions arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,6 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f)
spin_unlock(&(x)->ctx_lock);
}

static inline unsigned long
pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec)
{
return get_unmapped_area(file, addr, len, pgoff, flags);
}

/* forward declaration */
static const struct dentry_operations pfmfs_dentry_operations;

Expand Down Expand Up @@ -2333,8 +2327,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
down_write(&task->mm->mmap_sem);

/* find some free area in address space, must have mmap sem held */
vma->vm_start = pfm_get_unmapped_area(NULL, 0, size, 0, MAP_PRIVATE|MAP_ANONYMOUS, 0);
if (vma->vm_start == 0UL) {
vma->vm_start = get_unmapped_area(NULL, 0, size, 0, MAP_PRIVATE|MAP_ANONYMOUS);
if (IS_ERR_VALUE(vma->vm_start)) {
DPRINT(("Cannot find unmapped area for size %ld\n", size));
up_write(&task->mm->mmap_sem);
goto error;
Expand Down
19 changes: 3 additions & 16 deletions arch/ia64/kernel/sys_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,22 +171,9 @@ asmlinkage unsigned long
ia64_mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags,
unsigned long new_addr)
{
extern unsigned long do_mremap (unsigned long addr,
unsigned long old_len,
unsigned long new_len,
unsigned long flags,
unsigned long new_addr);

down_write(&current->mm->mmap_sem);
{
addr = do_mremap(addr, old_len, new_len, flags, new_addr);
}
up_write(&current->mm->mmap_sem);

if (IS_ERR((void *) addr))
return addr;

force_successful_syscall_return();
addr = sys_mremap(addr, old_len, new_len, flags, new_addr);
if (!IS_ERR((void *) addr))
force_successful_syscall_return();
return addr;
}

Expand Down
3 changes: 0 additions & 3 deletions arch/m32r/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/m68k/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
5 changes: 0 additions & 5 deletions arch/mips/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
* assume GCC is being used.
*/

#if (_MIPS_SZLONG == 64)
typedef unsigned int __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t
#endif

typedef long __kernel_daddr_t;
#define __kernel_daddr_t __kernel_daddr_t

Expand Down
6 changes: 3 additions & 3 deletions arch/mips/include/asm/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct stat {
long st_pad1[3]; /* Reserved for network id */
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
__u32 st_nlink;
uid_t st_uid;
gid_t st_gid;
unsigned st_rdev;
Expand Down Expand Up @@ -55,7 +55,7 @@ struct stat64 {
unsigned long long st_ino;

mode_t st_mode;
nlink_t st_nlink;
__u32 st_nlink;

uid_t st_uid;
gid_t st_gid;
Expand Down Expand Up @@ -96,7 +96,7 @@ struct stat {
unsigned long st_ino;

mode_t st_mode;
nlink_t st_nlink;
__u32 st_nlink;

uid_t st_uid;
gid_t st_gid;
Expand Down
3 changes: 0 additions & 3 deletions arch/mn10300/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
3 changes: 0 additions & 3 deletions arch/parisc/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
4 changes: 2 additions & 2 deletions arch/parisc/include/asm/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct stat {
unsigned int st_dev; /* dev_t is 32 bits on parisc */
ino_t st_ino; /* 32 bits */
mode_t st_mode; /* 16 bits */
nlink_t st_nlink; /* 16 bits */
unsigned short st_nlink; /* 16 bits */
unsigned short st_reserved1; /* old st_uid */
unsigned short st_reserved2; /* old st_gid */
unsigned int st_rdev;
Expand Down Expand Up @@ -42,7 +42,7 @@ struct hpux_stat64 {
unsigned int st_dev; /* dev_t is 32 bits on parisc */
ino_t st_ino; /* 32 bits */
mode_t st_mode; /* 16 bits */
nlink_t st_nlink; /* 16 bits */
unsigned short st_nlink; /* 16 bits */
unsigned short st_reserved1; /* old st_uid */
unsigned short st_reserved2; /* old st_gid */
unsigned int st_rdev;
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ typedef int __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
#define __kernel_size_t __kernel_size_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t
#endif
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/include/asm/stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ struct stat {
unsigned long st_dev;
ino_t st_ino;
#ifdef __powerpc64__
nlink_t st_nlink;
unsigned short st_nlink;
mode_t st_mode;
#else
mode_t st_mode;
nlink_t st_nlink;
unsigned short st_nlink;
#endif
uid_t st_uid;
gid_t st_gid;
Expand Down
3 changes: 0 additions & 3 deletions arch/s390/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ typedef unsigned short __kernel_old_dev_t;

typedef unsigned long __kernel_ino_t;
typedef unsigned short __kernel_mode_t;
typedef unsigned short __kernel_nlink_t;
typedef unsigned short __kernel_ipc_pid_t;
typedef unsigned short __kernel_uid_t;
typedef unsigned short __kernel_gid_t;
Expand All @@ -35,7 +34,6 @@ typedef int __kernel_ptrdiff_t;

typedef unsigned int __kernel_ino_t;
typedef unsigned int __kernel_mode_t;
typedef unsigned int __kernel_nlink_t;
typedef int __kernel_ipc_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
Expand All @@ -47,7 +45,6 @@ typedef unsigned long __kernel_sigset_t; /* at least 32 bits */

#define __kernel_ino_t __kernel_ino_t
#define __kernel_mode_t __kernel_mode_t
#define __kernel_nlink_t __kernel_nlink_t
#define __kernel_ipc_pid_t __kernel_ipc_pid_t
#define __kernel_uid_t __kernel_uid_t
#define __kernel_gid_t __kernel_gid_t
Expand Down
2 changes: 0 additions & 2 deletions arch/sh/include/asm/posix_types_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t
typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t
typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t
typedef unsigned short __kernel_uid_t;
Expand Down
2 changes: 0 additions & 2 deletions arch/sh/include/asm/posix_types_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t
typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t
typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t
typedef unsigned short __kernel_uid_t;
Expand Down
5 changes: 0 additions & 5 deletions arch/sparc/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#if defined(__sparc__) && defined(__arch64__)
/* sparc 64 bit */
typedef unsigned int __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
Expand Down Expand Up @@ -38,9 +36,6 @@ typedef unsigned short __kernel_gid_t;
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef long __kernel_daddr_t;
#define __kernel_daddr_t __kernel_daddr_t

Expand Down
11 changes: 2 additions & 9 deletions arch/sparc/kernel/sys_sparc_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,16 +580,9 @@ SYSCALL_DEFINE5(64_mremap, unsigned long, addr, unsigned long, old_len,
unsigned long, new_len, unsigned long, flags,
unsigned long, new_addr)
{
unsigned long ret = -EINVAL;

if (test_thread_flag(TIF_32BIT))
goto out;

down_write(&current->mm->mmap_sem);
ret = do_mremap(addr, old_len, new_len, flags, new_addr);
up_write(&current->mm->mmap_sem);
out:
return ret;
return -EINVAL;
return sys_mremap(addr, old_len, new_len, flags, new_addr);
}

/* we come to here via sys_nis_syscall so it can setup the regs argument */
Expand Down
1 change: 0 additions & 1 deletion arch/tile/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ typedef __kernel_uid32_t __compat_gid32_t;
typedef __kernel_mode_t compat_mode_t;
typedef __kernel_dev_t compat_dev_t;
typedef __kernel_loff_t compat_loff_t;
typedef __kernel_nlink_t compat_nlink_t;
typedef __kernel_ipc_pid_t compat_ipc_pid_t;
typedef __kernel_daddr_t compat_daddr_t;
typedef __kernel_fsid_t compat_fsid_t;
Expand Down
3 changes: 0 additions & 3 deletions arch/x86/include/asm/posix_types_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
typedef unsigned short __kernel_mode_t;
#define __kernel_mode_t __kernel_mode_t

typedef unsigned short __kernel_nlink_t;
#define __kernel_nlink_t __kernel_nlink_t

typedef unsigned short __kernel_ipc_pid_t;
#define __kernel_ipc_pid_t __kernel_ipc_pid_t

Expand Down
2 changes: 1 addition & 1 deletion drivers/base/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct device *soc_device_to_device(struct soc_device *soc_dev)
return &soc_dev->dev;
}

static mode_t soc_attribute_mode(struct kobject *kobj,
static umode_t soc_attribute_mode(struct kobject *kobj,
struct attribute *attr,
int index)
{
Expand Down
Loading

0 comments on commit 1193755

Please sign in to comment.