Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 26 Apr 2015 22:48:49 +0000 (15:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 27 Apr 2015 00:22:07 +0000 (17:22 -0700)
Pull fourth vfs update from Al Viro:
 "d_inode() annotations from David Howells (sat in for-next since before
  the beginning of merge window) + four assorted fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  RCU pathwalk breakage when running into a symlink overmounting something
  fix I_DIO_WAKEUP definition
  direct-io: only inc/dec inode->i_dio_count for file systems
  fs/9p: fix readdir()
  VFS: assorted d_backing_inode() annotations
  VFS: fs/inode.c helpers: d_inode() annotations
  VFS: fs/cachefiles: d_backing_inode() annotations
  VFS: fs library helpers: d_inode() annotations
  VFS: assorted weird filesystems: d_inode() annotations
  VFS: normal filesystems (and lustre): d_inode() annotations
  VFS: security/: d_inode() annotations
  VFS: security/: d_backing_inode() annotations
  VFS: net/: d_inode() annotations
  VFS: net/unix: d_backing_inode() annotations
  VFS: kernel/: d_inode() annotations
  VFS: audit: d_backing_inode() annotations
  VFS: Fix up some ->d_inode accesses in the chelsio driver
  VFS: Cachefiles should perform fs modifications on the top layer only
  VFS: AF_UNIX sockets should call mknod on the top layer only

97 files changed:
1  2 
drivers/mtd/ubi/build.c
drivers/staging/lustre/lustre/llite/dcache.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/llite/namei.c
drivers/staging/lustre/lustre/llite/statahead.c
fs/affs/amigaffs.c
fs/affs/inode.c
fs/affs/namei.c
fs/befs/linuxvfs.c
fs/bfs/dir.c
fs/binfmt_misc.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/super.c
fs/btrfs/tree-log.c
fs/btrfs/xattr.c
fs/ceph/caps.c
fs/ceph/dir.c
fs/ceph/mds_client.c
fs/ceph/super.c
fs/ceph/xattr.c
fs/dax.c
fs/debugfs/inode.c
fs/ext2/inode.c
fs/ext2/namei.c
fs/ext3/super.c
fs/ext3/xattr.c
fs/ext4/fsync.c
fs/ext4/ialloc.c
fs/ext4/inline.c
fs/ext4/inode.c
fs/ext4/namei.c
fs/ext4/super.c
fs/ext4/symlink.c
fs/ext4/xattr.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/namei.c
fs/f2fs/xattr.c
fs/fat/file.c
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/gfs2/inode.c
fs/gfs2/xattr.c
fs/hfs/dir.c
fs/hfsplus/dir.c
fs/hfsplus/inode.c
fs/hfsplus/ioctl.c
fs/hfsplus/xattr.c
fs/hostfs/hostfs_kern.c
fs/hugetlbfs/inode.c
fs/jffs2/xattr.c
fs/nfs/write.c
fs/nfsd/export.c
fs/nfsd/nfs4acl.c
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/xdr4.h
fs/nilfs2/inode.c
fs/nilfs2/super.c
fs/ocfs2/export.c
fs/ocfs2/inode.c
fs/ocfs2/namei.c
fs/ocfs2/refcounttree.c
fs/ocfs2/xattr.c
fs/proc/base.c
fs/proc/fd.c
fs/pstore/inode.c
fs/quota/dquot.c
fs/reiserfs/super.c
fs/ubifs/dir.c
fs/ubifs/file.c
fs/ubifs/journal.c
fs/ubifs/xattr.c
fs/udf/file.c
fs/udf/namei.c
fs/xfs/xfs_filestream.c
fs/xfs/xfs_ioctl.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_super.c
include/linux/fs.h
include/trace/events/btrfs.h
include/trace/events/ext3.h
include/trace/events/ext4.h
ipc/shm.c
kernel/audit.c
kernel/audit_tree.c
kernel/auditsc.c
kernel/trace/trace.c
kernel/trace/trace_events.c
kernel/trace/trace_uprobe.c
security/lsm_audit.c
security/smack/smack_lsm.c
security/smack/smackfs.c

Simple merge
index 5022ac96aa40f0ef1a05bd5f75e2d93de92cee77,40eb5814b98c06ec4633c2c964e4a69c67db4ba3..a8f463c028ce9e9c52862e01a21de82a5b7e2f09
@@@ -471,10 -471,9 +471,9 @@@ affs_warning(struct super_block *sb, co
  bool
  affs_nofilenametruncate(const struct dentry *dentry)
  {
-       struct inode *inode = dentry->d_inode;
+       struct inode *inode = d_inode(dentry);
 -      return AFFS_SB(inode->i_sb)->s_flags & SF_NO_TRUNCATE;
  
 +      return affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_NO_TRUNCATE);
  }
  
  /* Check if the name is valid for a affs object. */
diff --cc fs/affs/inode.c
Simple merge
diff --cc fs/affs/namei.c
Simple merge
index 16e0a48bfccd41e904a8044beced4d84af1bdbe7,d3cb8774765f392f0710d3ba7122fe518f6c0e74..7943533c386802dc880051cc7ac2b078cf5d3ccb
@@@ -471,7 -472,7 +471,7 @@@ static void 
  befs_follow_link(struct dentry *dentry, struct nameidata *nd)
  {
        struct super_block *sb = dentry->d_sb;
-       struct befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
 -      befs_inode_info *befs_ino = BEFS_I(d_inode(dentry));
++      struct befs_inode_info *befs_ino = BEFS_I(d_inode(dentry));
        befs_data_stream *data = &befs_ino->i_data.ds;
        befs_off_t len = data->size;
        char *link;
  static void *
  befs_fast_follow_link(struct dentry *dentry, struct nameidata *nd)
  {
-       struct befs_inode_info *befs_ino = BEFS_I(dentry->d_inode);
 -      befs_inode_info *befs_ino = BEFS_I(d_inode(dentry));
++      struct befs_inode_info *befs_ino = BEFS_I(d_inode(dentry));
 +
        nd_set_link(nd, befs_ino->i_data.symlink);
        return NULL;
  }
diff --cc fs/bfs/dir.c
Simple merge
Simple merge
diff --cc fs/btrfs/file.c
Simple merge
Simple merge
Simple merge
Simple merge
index a089b5944efca4b52060243a16bbee65919fbfbd,25db71be462a12dc9649430f6c9b9dd9f0051d4f..d04968374e9d8bd5b118024d53ea0a5bfa6d0bd2
@@@ -4773,14 -4449,11 +4773,14 @@@ static int btrfs_log_inode_parent(struc
                goto end_trans;
        }
  
 +      if (S_ISDIR(inode->i_mode) && ctx && ctx->log_new_dentries)
 +              log_dentries = true;
 +
        while (1) {
-               if (!parent || !parent->d_inode || sb != parent->d_inode->i_sb)
+               if (!parent || d_really_is_negative(parent) || sb != d_inode(parent)->i_sb)
                        break;
  
-               inode = parent->d_inode;
+               inode = d_inode(parent);
                if (root != BTRFS_I(inode)->root)
                        break;
  
index 45ea704be0309d34bbad4542df2a31b960acd361,4cca14ecb660b1dda0c34f040c008f9d019cb738..6f518c90e1c14b6966d80ab9202c0bff0e399686
@@@ -408,17 -388,15 +408,17 @@@ ssize_t btrfs_getxattr(struct dentry *d
        if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
                return generic_getxattr(dentry, name, buffer, size);
  
 -      if (!btrfs_is_valid_xattr(name))
 -              return -EOPNOTSUPP;
 +      ret = btrfs_is_valid_xattr(name);
 +      if (ret)
 +              return ret;
-       return __btrfs_getxattr(dentry->d_inode, name, buffer, size);
+       return __btrfs_getxattr(d_inode(dentry), name, buffer, size);
  }
  
  int btrfs_setxattr(struct dentry *dentry, const char *name, const void *value,
                   size_t size, int flags)
  {
-       struct btrfs_root *root = BTRFS_I(dentry->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(d_inode(dentry))->root;
 +      int ret;
  
        /*
         * The permission on security.* and system.* is not checked
        if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
                return generic_setxattr(dentry, name, value, size, flags);
  
 -      if (!btrfs_is_valid_xattr(name))
 -              return -EOPNOTSUPP;
 +      ret = btrfs_is_valid_xattr(name);
 +      if (ret)
 +              return ret;
  
        if (!strncmp(name, XATTR_BTRFS_PREFIX, XATTR_BTRFS_PREFIX_LEN))
-               return btrfs_set_prop(dentry->d_inode, name,
+               return btrfs_set_prop(d_inode(dentry), name,
                                      value, size, flags);
  
        if (size == 0)
  
  int btrfs_removexattr(struct dentry *dentry, const char *name)
  {
-       struct btrfs_root *root = BTRFS_I(dentry->d_inode)->root;
+       struct btrfs_root *root = BTRFS_I(d_inode(dentry))->root;
 +      int ret;
  
        /*
         * The permission on security.* and system.* is not checked
        if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
                return generic_removexattr(dentry, name);
  
 -      if (!btrfs_is_valid_xattr(name))
 -              return -EOPNOTSUPP;
 +      ret = btrfs_is_valid_xattr(name);
 +      if (ret)
 +              return ret;
  
        if (!strncmp(name, XATTR_BTRFS_PREFIX, XATTR_BTRFS_PREFIX_LEN))
-               return btrfs_set_prop(dentry->d_inode, name,
+               return btrfs_set_prop(d_inode(dentry), name,
                                      NULL, 0, XATTR_REPLACE);
  
-       return __btrfs_setxattr(NULL, dentry->d_inode, name, NULL, 0,
+       return __btrfs_setxattr(NULL, d_inode(dentry), name, NULL, 0,
                                XATTR_REPLACE);
  }
  
diff --cc fs/ceph/caps.c
Simple merge
diff --cc fs/ceph/dir.c
Simple merge
index 0a2eb32ffe435383735dfd27fef183b715df5c51,a39389092102ce2052f72f3a59781ae9ec4f8e35..84f37f34f9aa663952a60e8a3440a81934c083b0
@@@ -1955,14 -1935,8 +1955,14 @@@ static struct ceph_msg *create_request_
                       mds, req->r_old_dentry_drop, req->r_old_dentry_unless);
        if (req->r_old_inode_drop)
                releases += ceph_encode_inode_release(&p,
-                     req->r_old_dentry->d_inode,
+                     d_inode(req->r_old_dentry),
                      mds, req->r_old_inode_drop, req->r_old_inode_unless, 0);
 +
 +      if (drop_cap_releases) {
 +              releases = 0;
 +              p = msg->front.iov_base + req->r_request_release_offset;
 +      }
 +
        head->num_releases = cpu_to_le16(releases);
  
        /* time stamp */
diff --cc fs/ceph/super.c
Simple merge
diff --cc fs/ceph/xattr.c
Simple merge
diff --cc fs/dax.c
Simple merge
Simple merge
diff --cc fs/ext2/inode.c
Simple merge
diff --cc fs/ext2/namei.c
Simple merge
diff --cc fs/ext3/super.c
Simple merge
diff --cc fs/ext3/xattr.c
Simple merge
diff --cc fs/ext4/fsync.c
Simple merge
Simple merge
Simple merge
diff --cc fs/ext4/inode.c
Simple merge
diff --cc fs/ext4/namei.c
index ef22cd951c0c31cb58b10f368753f8c08f5af98a,e086eebe335e7e33a37bfd3dfd7ba391a7a36b2d..7223b0b4bc38cd0a67a8b53eadcd616396d5dce5
@@@ -2048,14 -1732,9 +2048,14 @@@ static int add_dirent_to_buf(handle_t *
  static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
                            struct inode *inode, struct buffer_head *bh)
  {
-       struct inode    *dir = dentry->d_parent->d_inode;
+       struct inode    *dir = d_inode(dentry->d_parent);
 +#ifdef CONFIG_EXT4_FS_ENCRYPTION
 +      struct ext4_fname_crypto_ctx *ctx = NULL;
 +      int res;
 +#else
        const char      *name = dentry->d_name.name;
        int             namelen = dentry->d_name.len;
 +#endif
        struct buffer_head *bh2;
        struct dx_root  *root;
        struct dx_frame frames[2], *frame;
@@@ -2202,8 -1864,8 +2202,8 @@@ out_frames
  static int ext4_add_entry(handle_t *handle, struct dentry *dentry,
                          struct inode *inode)
  {
-       struct inode *dir = dentry->d_parent->d_inode;
+       struct inode *dir = d_inode(dentry->d_parent);
 -      struct buffer_head *bh;
 +      struct buffer_head *bh = NULL;
        struct ext4_dir_entry_2 *de;
        struct ext4_dir_entry_tail *t;
        struct super_block *sb;
diff --cc fs/ext4/super.c
Simple merge
index 136ca0e911fd71efa681746c72da1a99cae1d949,57f50091b8d1285e7c16638504a08e6a268f9b16..19f78f20975ea723f33e6488750f9645a7ea2d4a
  #include "ext4.h"
  #include "xattr.h"
  
 +#ifdef CONFIG_EXT4_FS_ENCRYPTION
  static void *ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
-       struct inode *inode = dentry->d_inode;
 +{
 +      struct page *cpage = NULL;
 +      char *caddr, *paddr = NULL;
 +      struct ext4_str cstr, pstr;
-               caddr = (char *) EXT4_I(dentry->d_inode)->i_data;
-               max_size = sizeof(EXT4_I(dentry->d_inode)->i_data);
++      struct inode *inode = d_inode(dentry);
 +      struct ext4_fname_crypto_ctx *ctx = NULL;
 +      struct ext4_encrypted_symlink_data *sd;
 +      loff_t size = min_t(loff_t, i_size_read(inode), PAGE_SIZE - 1);
 +      int res;
 +      u32 plen, max_size = inode->i_sb->s_blocksize;
 +
 +      if (!ext4_encrypted_inode(inode))
 +              return page_follow_link_light(dentry, nd);
 +
 +      ctx = ext4_get_fname_crypto_ctx(inode, inode->i_sb->s_blocksize);
 +      if (IS_ERR(ctx))
 +              return ctx;
 +
 +      if (ext4_inode_is_fast_symlink(inode)) {
++              caddr = (char *) EXT4_I(inode)->i_data;
++              max_size = sizeof(EXT4_I(inode)->i_data);
 +      } else {
 +              cpage = read_mapping_page(inode->i_mapping, 0, NULL);
 +              if (IS_ERR(cpage)) {
 +                      ext4_put_fname_crypto_ctx(&ctx);
 +                      return cpage;
 +              }
 +              caddr = kmap(cpage);
 +              caddr[size] = 0;
 +      }
 +
 +      /* Symlink is encrypted */
 +      sd = (struct ext4_encrypted_symlink_data *)caddr;
 +      cstr.name = sd->encrypted_path;
 +      cstr.len  = le32_to_cpu(sd->len);
 +      if ((cstr.len +
 +           sizeof(struct ext4_encrypted_symlink_data) - 1) >
 +          max_size) {
 +              /* Symlink data on the disk is corrupted */
 +              res = -EIO;
 +              goto errout;
 +      }
 +      plen = (cstr.len < EXT4_FNAME_CRYPTO_DIGEST_SIZE*2) ?
 +              EXT4_FNAME_CRYPTO_DIGEST_SIZE*2 : cstr.len;
 +      paddr = kmalloc(plen + 1, GFP_NOFS);
 +      if (!paddr) {
 +              res = -ENOMEM;
 +              goto errout;
 +      }
 +      pstr.name = paddr;
 +      res = _ext4_fname_disk_to_usr(ctx, &cstr, &pstr);
 +      if (res < 0)
 +              goto errout;
 +      /* Null-terminate the name */
 +      if (res <= plen)
 +              paddr[res] = '\0';
 +      nd_set_link(nd, paddr);
 +      ext4_put_fname_crypto_ctx(&ctx);
 +      if (cpage) {
 +              kunmap(cpage);
 +              page_cache_release(cpage);
 +      }
 +      return NULL;
 +errout:
 +      ext4_put_fname_crypto_ctx(&ctx);
 +      if (cpage) {
 +              kunmap(cpage);
 +              page_cache_release(cpage);
 +      }
 +      kfree(paddr);
 +      return ERR_PTR(res);
 +}
 +
 +static void ext4_put_link(struct dentry *dentry, struct nameidata *nd,
 +                        void *cookie)
 +{
 +      struct page *page = cookie;
 +
 +      if (!page) {
 +              kfree(nd_get_link(nd));
 +      } else {
 +              kunmap(page);
 +              page_cache_release(page);
 +      }
 +}
 +#endif
 +
 +static void *ext4_follow_fast_link(struct dentry *dentry, struct nameidata *nd)
  {
-       struct ext4_inode_info *ei = EXT4_I(dentry->d_inode);
+       struct ext4_inode_info *ei = EXT4_I(d_inode(dentry));
        nd_set_link(nd, (char *) ei->i_data);
        return NULL;
  }
diff --cc fs/ext4/xattr.c
Simple merge
diff --cc fs/f2fs/f2fs.h
index c06a25e5cec335d8195cf027623fc8021bca1f38,02e4ab3e7d4d6b327bdd39927882eff1f7efee98..d8921cf2ba9a04454e553a75535dfa84d2b4da67
@@@ -1482,8 -1391,8 +1482,8 @@@ bool f2fs_empty_dir(struct inode *)
  
  static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
  {
-       return __f2fs_add_link(dentry->d_parent->d_inode, &dentry->d_name,
+       return __f2fs_add_link(d_inode(dentry->d_parent), &dentry->d_name,
 -                              inode);
 +                              inode, inode->i_ino, inode->i_mode);
  }
  
  /*
diff --cc fs/f2fs/file.c
Simple merge
diff --cc fs/f2fs/namei.c
index 407dde3d7a92273a790aefb2ace267f3be0ece74,ed7404706ca4d878464a95e1f0f39f1a852c1450..7e3794edae42ab5c656f2ae9fec69e7431476b35
@@@ -182,50 -181,12 +182,50 @@@ out
  struct dentry *f2fs_get_parent(struct dentry *child)
  {
        struct qstr dotdot = QSTR_INIT("..", 2);
-       unsigned long ino = f2fs_inode_by_name(child->d_inode, &dotdot);
+       unsigned long ino = f2fs_inode_by_name(d_inode(child), &dotdot);
        if (!ino)
                return ERR_PTR(-ENOENT);
-       return d_obtain_alias(f2fs_iget(child->d_inode->i_sb, ino));
+       return d_obtain_alias(f2fs_iget(d_inode(child)->i_sb, ino));
  }
  
 +static int __recover_dot_dentries(struct inode *dir, nid_t pino)
 +{
 +      struct f2fs_sb_info *sbi = F2FS_I_SB(dir);
 +      struct qstr dot = QSTR_INIT(".", 1);
 +      struct qstr dotdot = QSTR_INIT("..", 2);
 +      struct f2fs_dir_entry *de;
 +      struct page *page;
 +      int err = 0;
 +
 +      f2fs_lock_op(sbi);
 +
 +      de = f2fs_find_entry(dir, &dot, &page);
 +      if (de) {
 +              f2fs_dentry_kunmap(dir, page);
 +              f2fs_put_page(page, 0);
 +      } else {
 +              err = __f2fs_add_link(dir, &dot, NULL, dir->i_ino, S_IFDIR);
 +              if (err)
 +                      goto out;
 +      }
 +
 +      de = f2fs_find_entry(dir, &dotdot, &page);
 +      if (de) {
 +              f2fs_dentry_kunmap(dir, page);
 +              f2fs_put_page(page, 0);
 +      } else {
 +              err = __f2fs_add_link(dir, &dotdot, NULL, pino, S_IFDIR);
 +      }
 +out:
 +      if (!err) {
 +              clear_inode_flag(F2FS_I(dir), FI_INLINE_DOTS);
 +              mark_inode_dirty(dir);
 +      }
 +
 +      f2fs_unlock_op(sbi);
 +      return err;
 +}
 +
  static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
                unsigned int flags)
  {
diff --cc fs/f2fs/xattr.c
Simple merge
diff --cc fs/fat/file.c
Simple merge
Simple merge
Simple merge
diff --cc fs/gfs2/inode.c
Simple merge
diff --cc fs/gfs2/xattr.c
Simple merge
diff --cc fs/hfs/dir.c
Simple merge
Simple merge
Simple merge
Simple merge
index 89f262d8fcd87bd0bdc6fbf42e4338f581093658,964d922f647edcab14cc02e2d9451c70710cec40..416b1dbafe516583b22efad4a851e7f6cf2abb25
@@@ -424,28 -424,6 +424,28 @@@ static int copy_name(char *buffer, cons
        return len;
  }
  
-       res = __hfsplus_setxattr(dentry->d_inode, xattr_name, value, size,
 +int hfsplus_setxattr(struct dentry *dentry, const char *name,
 +                   const void *value, size_t size, int flags,
 +                   const char *prefix, size_t prefixlen)
 +{
 +      char *xattr_name;
 +      int res;
 +
 +      if (!strcmp(name, ""))
 +              return -EINVAL;
 +
 +      xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN + 1,
 +              GFP_KERNEL);
 +      if (!xattr_name)
 +              return -ENOMEM;
 +      strcpy(xattr_name, prefix);
 +      strcpy(xattr_name + prefixlen, name);
++      res = __hfsplus_setxattr(d_inode(dentry), xattr_name, value, size,
 +                               flags);
 +      kfree(xattr_name);
 +      return res;
 +}
 +
  static ssize_t hfsplus_getxattr_finder_info(struct inode *inode,
                                                void *value, size_t size)
  {
@@@ -582,30 -560,6 +582,30 @@@ failed_getxattr_init
        return res;
  }
  
-       res = __hfsplus_getxattr(dentry->d_inode, xattr_name, value, size);
 +ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
 +                       void *value, size_t size,
 +                       const char *prefix, size_t prefixlen)
 +{
 +      int res;
 +      char *xattr_name;
 +
 +      if (!strcmp(name, ""))
 +              return -EINVAL;
 +
 +      xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN + 1,
 +                           GFP_KERNEL);
 +      if (!xattr_name)
 +              return -ENOMEM;
 +
 +      strcpy(xattr_name, prefix);
 +      strcpy(xattr_name + prefixlen, name);
 +
++      res = __hfsplus_getxattr(d_inode(dentry), xattr_name, value, size);
 +      kfree(xattr_name);
 +      return res;
 +
 +}
 +
  static inline int can_list(const char *xattr_name)
  {
        if (!xattr_name)
@@@ -861,14 -818,16 +861,14 @@@ static int hfsplus_osx_getxattr(struct 
         */
        if (is_known_namespace(name))
                return -EOPNOTSUPP;
 -      xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN
 -              + XATTR_MAC_OSX_PREFIX_LEN + 1, GFP_KERNEL);
 -      if (!xattr_name)
 -              return -ENOMEM;
 -      strcpy(xattr_name, XATTR_MAC_OSX_PREFIX);
 -      strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name);
  
 -      res = hfsplus_getxattr(dentry, xattr_name, buffer, size);
 -      kfree(xattr_name);
 -      return res;
 +      /*
 +       * osx is the namespace we use to indicate an unprefixed
 +       * attribute on the filesystem (like the ones that OS X
 +       * creates), so we pass the name through unmodified (after
 +       * ensuring it doesn't conflict with another namespace).
 +       */
-       return __hfsplus_getxattr(dentry->d_inode, name, buffer, size);
++      return __hfsplus_getxattr(d_inode(dentry), name, buffer, size);
  }
  
  static int hfsplus_osx_setxattr(struct dentry *dentry, const char *name,
         */
        if (is_known_namespace(name))
                return -EOPNOTSUPP;
 -      xattr_name = kmalloc(NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN
 -              + XATTR_MAC_OSX_PREFIX_LEN + 1, GFP_KERNEL);
 -      if (!xattr_name)
 -              return -ENOMEM;
 -      strcpy(xattr_name, XATTR_MAC_OSX_PREFIX);
 -      strcpy(xattr_name + XATTR_MAC_OSX_PREFIX_LEN, name);
  
 -      res = hfsplus_setxattr(dentry, xattr_name, buffer, size, flags);
 -      kfree(xattr_name);
 -      return res;
 +      /*
 +       * osx is the namespace we use to indicate an unprefixed
 +       * attribute on the filesystem (like the ones that OS X
 +       * creates), so we pass the name through unmodified (after
 +       * ensuring it doesn't conflict with another namespace).
 +       */
-       return __hfsplus_setxattr(dentry->d_inode, name, buffer, size, flags);
++      return __hfsplus_setxattr(d_inode(dentry), name, buffer, size, flags);
  }
  
  static size_t hfsplus_osx_listxattr(struct dentry *dentry, char *list,
Simple merge
Simple merge
Simple merge
diff --cc fs/nfs/write.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/nfsd/xdr4.h
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/proc/base.c
Simple merge
diff --cc fs/proc/fd.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/ubifs/dir.c
Simple merge
diff --cc fs/ubifs/file.c
Simple merge
Simple merge
Simple merge
diff --cc fs/udf/file.c
Simple merge
diff --cc fs/udf/namei.c
Simple merge
Simple merge
Simple merge
index 2f1839e4dd1bf0e24af0a9e03243a03df708b79d,54b95232d94662124bf38f932bd28817bb3529fe..f4cd7204e23667724c01a4c4b8efe8c1d48b1cb3
@@@ -953,13 -975,9 +953,13 @@@ xfs_vn_setattr
                uint            iolock = XFS_IOLOCK_EXCL;
  
                xfs_ilock(ip, iolock);
-               error = xfs_break_layouts(dentry->d_inode, &iolock, true);
 -              error = xfs_break_layouts(d_inode(dentry), &iolock);
 -              if (!error)
++              error = xfs_break_layouts(d_inode(dentry), &iolock, true);
 +              if (!error) {
 +                      xfs_ilock(ip, XFS_MMAPLOCK_EXCL);
 +                      iolock |= XFS_MMAPLOCK_EXCL;
 +
                        error = xfs_setattr_size(ip, iattr);
 +              }
                xfs_iunlock(ip, iolock);
        } else {
                error = xfs_setattr_nonsize(ip, iattr, 0);
index 5f357ca97e76071be79e999c79ef5cb6b6015024,72e97e31d3b17be91c719ca894bccc658c3df76b..858e1e62bbaa390d0ea34a5b7766274f04361fd2
@@@ -1048,11 -1083,8 +1048,11 @@@ xfs_fs_statfs
  {
        struct xfs_mount        *mp = XFS_M(dentry->d_sb);
        xfs_sb_t                *sbp = &mp->m_sb;
-       struct xfs_inode        *ip = XFS_I(dentry->d_inode);
+       struct xfs_inode        *ip = XFS_I(d_inode(dentry));
        __uint64_t              fakeinos, id;
 +      __uint64_t              icount;
 +      __uint64_t              ifree;
 +      __uint64_t              fdblocks;
        xfs_extlen_t            lsize;
        __int64_t               ffree;
  
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc ipc/shm.c
Simple merge
diff --cc kernel/audit.c
Simple merge
index 71fd1f28988532d10efa26ce0a1e47632eacf8b2,70bd2532437bb25a184bd538939a2027cb517652..b0f9877273fc39746fa063849f1bac51487d8606
@@@ -649,60 -648,9 +649,60 @@@ void audit_put_tree(struct audit_tree *
  
  static int tag_mount(struct vfsmount *mnt, void *arg)
  {
-       return tag_chunk(mnt->mnt_root->d_inode, arg);
+       return tag_chunk(d_backing_inode(mnt->mnt_root), arg);
  }
  
 +/*
 + * That gets run when evict_chunk() ends up needing to kill audit_tree.
 + * Runs from a separate thread.
 + */
 +static int prune_tree_thread(void *unused)
 +{
 +      for (;;) {
 +              set_current_state(TASK_INTERRUPTIBLE);
 +              if (list_empty(&prune_list))
 +                      schedule();
 +              __set_current_state(TASK_RUNNING);
 +
 +              mutex_lock(&audit_cmd_mutex);
 +              mutex_lock(&audit_filter_mutex);
 +
 +              while (!list_empty(&prune_list)) {
 +                      struct audit_tree *victim;
 +
 +                      victim = list_entry(prune_list.next,
 +                                      struct audit_tree, list);
 +                      list_del_init(&victim->list);
 +
 +                      mutex_unlock(&audit_filter_mutex);
 +
 +                      prune_one(victim);
 +
 +                      mutex_lock(&audit_filter_mutex);
 +              }
 +
 +              mutex_unlock(&audit_filter_mutex);
 +              mutex_unlock(&audit_cmd_mutex);
 +      }
 +      return 0;
 +}
 +
 +static int audit_launch_prune(void)
 +{
 +      if (prune_thread)
 +              return 0;
 +      prune_thread = kthread_create(prune_tree_thread, NULL,
 +                              "audit_prune_tree");
 +      if (IS_ERR(prune_thread)) {
 +              pr_err("cannot start thread audit_prune_tree");
 +              prune_thread = NULL;
 +              return -ENOMEM;
 +      } else {
 +              wake_up_process(prune_thread);
 +              return 0;
 +      }
 +}
 +
  /* called with audit_filter_mutex */
  int audit_add_tree_rule(struct audit_krule *rule)
  {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge