Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 7 Aug 2016 14:01:14 +0000 (10:01 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 7 Aug 2016 14:01:14 +0000 (10:01 -0400)
Pull more vfs updates from Al Viro:
 "Assorted cleanups and fixes.

  In the "trivial API change" department - ->d_compare() losing 'parent'
  argument"

* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  cachefiles: Fix race between inactivating and culling a cache object
  9p: use clone_fid()
  9p: fix braino introduced in "9p: new helper - v9fs_parent_fid()"
  vfs: make dentry_needs_remove_privs() internal
  vfs: remove file_needs_remove_privs()
  vfs: fix deadlock in file_remove_privs() on overlayfs
  get rid of 'parent' argument of ->d_compare()
  cifs, msdos, vfat, hfs+: don't bother with parent in ->d_compare()
  affs ->d_compare(): don't bother with ->d_inode
  fold _d_rehash() and __d_rehash() together
  fold dentry_rcuwalk_invalidate() into its only remaining caller

1  2 
fs/adfs/dir.c
fs/dcache.c
fs/fat/namei_vfat.c
fs/hfs/hfs_fs.h
fs/hfsplus/hfsplus_fs.h
fs/inode.c
fs/proc/proc_sysctl.c
include/linux/dcache.h
include/linux/fs.h

diff --combined fs/adfs/dir.c
index c39aedc7ed3dca520ff2a524badcc3c6d3ee559c,c30a5a65cbb50cab282845abb36cc4cbc9ac8c26..29444c83da48c35940276075b8cfbfc6aa7ec457
@@@ -101,7 -101,7 +101,7 @@@ out
  }
  
  static int
 -adfs_match(struct qstr *name, struct object_info *obj)
 +adfs_match(const struct qstr *name, struct object_info *obj)
  {
        int i;
  
  }
  
  static int
 -adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj)
 +adfs_dir_lookup_byname(struct inode *inode, const struct qstr *name, struct object_info *obj)
  {
        struct super_block *sb = inode->i_sb;
        const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
@@@ -227,7 -227,7 +227,7 @@@ adfs_hash(const struct dentry *parent, 
   * requirements of the underlying filesystem.
   */
  static int
- adfs_compare(const struct dentry *parent, const struct dentry *dentry,
+ adfs_compare(const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
  {
        int i;
diff --combined fs/dcache.c
index 96635a30fb26c2133d4dfa0f6aed54840bbdfb60,32a9209c813872516cde2f8394f463f91e3f9fd0..5c7cc953ac8191d80bc899f5bb510e9d71d7d69d
@@@ -316,20 -316,6 +316,6 @@@ static void dentry_free(struct dentry *
                call_rcu(&dentry->d_u.d_rcu, __d_free);
  }
  
- /**
-  * dentry_rcuwalk_invalidate - invalidate in-progress rcu-walk lookups
-  * @dentry: the target dentry
-  * After this call, in-progress rcu-walk path lookup will fail. This
-  * should be called after unhashing, and after changing d_inode (if
-  * the dentry has not already been unhashed).
-  */
- static inline void dentry_rcuwalk_invalidate(struct dentry *dentry)
- {
-       lockdep_assert_held(&dentry->d_lock);
-       /* Go through am invalidation barrier */
-       write_seqcount_invalidate(&dentry->d_seq);
- }
  /*
   * Release the dentry's inode, using the filesystem
   * d_iput() operation if defined.
@@@ -468,7 -454,8 +454,8 @@@ void __d_drop(struct dentry *dentry
                __hlist_bl_del(&dentry->d_hash);
                dentry->d_hash.pprev = NULL;
                hlist_bl_unlock(b);
-               dentry_rcuwalk_invalidate(dentry);
+               /* After this call, in-progress rcu-walk path lookup will fail. */
+               write_seqcount_invalidate(&dentry->d_seq);
        }
  }
  EXPORT_SYMBOL(__d_drop);
@@@ -2060,7 -2047,7 +2047,7 @@@ static inline bool d_same_name(const st
                        return false;
                return dentry_cmp(dentry, name->name, name->len) == 0;
        }
-       return parent->d_op->d_compare(parent, dentry,
+       return parent->d_op->d_compare(dentry,
                                       dentry->d_name.len, dentry->d_name.name,
                                       name) == 0;
  }
@@@ -2163,7 -2150,7 +2150,7 @@@ seqretry
                                cpu_relax();
                                goto seqretry;
                        }
-                       if (parent->d_op->d_compare(parent, dentry,
+                       if (parent->d_op->d_compare(dentry,
                                                    tlen, tname, name) != 0)
                                continue;
                } else {
@@@ -2352,19 -2339,15 +2339,15 @@@ again
  }
  EXPORT_SYMBOL(d_delete);
  
- static void __d_rehash(struct dentry * entry, struct hlist_bl_head *b)
+ static void __d_rehash(struct dentry *entry)
  {
+       struct hlist_bl_head *b = d_hash(entry->d_name.hash);
        BUG_ON(!d_unhashed(entry));
        hlist_bl_lock(b);
        hlist_bl_add_head_rcu(&entry->d_hash, b);
        hlist_bl_unlock(b);
  }
  
- static void _d_rehash(struct dentry * entry)
- {
-       __d_rehash(entry, d_hash(entry->d_name.hash));
- }
  /**
   * d_rehash   - add an entry back to the hash
   * @entry: dentry to add to the hash
  void d_rehash(struct dentry * entry)
  {
        spin_lock(&entry->d_lock);
-       _d_rehash(entry);
+       __d_rehash(entry);
        spin_unlock(&entry->d_lock);
  }
  EXPORT_SYMBOL(d_rehash);
@@@ -2549,7 -2532,7 +2532,7 @@@ static inline void __d_add(struct dentr
                raw_write_seqcount_end(&dentry->d_seq);
                fsnotify_update_flags(dentry);
        }
-       _d_rehash(dentry);
+       __d_rehash(dentry);
        if (dir)
                end_dir_add(dir, n);
        spin_unlock(&dentry->d_lock);
@@@ -2611,7 -2594,7 +2594,7 @@@ struct dentry *d_exact_alias(struct den
                        alias = NULL;
                } else {
                        __dget_dlock(alias);
-                       _d_rehash(alias);
+                       __d_rehash(alias);
                        spin_unlock(&alias->d_lock);
                }
                spin_unlock(&inode->i_lock);
@@@ -2636,7 -2619,7 +2619,7 @@@ EXPORT_SYMBOL(d_exact_alias)
   * Parent inode i_mutex must be held over d_lookup and into this call (to
   * keep renames and concurrent inserts, and readdir(2) away).
   */
 -void dentry_update_name_case(struct dentry *dentry, struct qstr *name)
 +void dentry_update_name_case(struct dentry *dentry, const struct qstr *name)
  {
        BUG_ON(!inode_is_locked(dentry->d_parent->d_inode));
        BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */
@@@ -2795,23 -2778,10 +2778,10 @@@ static void __d_move(struct dentry *den
        write_seqcount_begin(&dentry->d_seq);
        write_seqcount_begin_nested(&target->d_seq, DENTRY_D_LOCK_NESTED);
  
+       /* unhash both */
        /* __d_drop does write_seqcount_barrier, but they're OK to nest. */
-       /*
-        * Move the dentry to the target hash queue. Don't bother checking
-        * for the same hash queue because of how unlikely it is.
-        */
        __d_drop(dentry);
-       __d_rehash(dentry, d_hash(target->d_name.hash));
-       /*
-        * Unhash the target (d_delete() is not usable here).  If exchanging
-        * the two dentries, then rehash onto the other's hash queue.
-        */
        __d_drop(target);
-       if (exchange) {
-               __d_rehash(target, d_hash(dentry->d_name.hash));
-       }
  
        /* Switch the names.. */
        if (exchange)
        else
                copy_name(dentry, target);
  
+       /* rehash in new place(s) */
+       __d_rehash(dentry);
+       if (exchange)
+               __d_rehash(target);
        /* ... and switch them in the tree */
        if (IS_ROOT(dentry)) {
                /* splicing a tree */
@@@ -3038,7 -3013,7 +3013,7 @@@ static int prepend(char **buffer, int *
   * Data dependency barrier is needed to make sure that we see that terminating
   * NUL.  Alpha strikes again, film at 11...
   */
 -static int prepend_name(char **buffer, int *buflen, struct qstr *name)
 +static int prepend_name(char **buffer, int *buflen, const struct qstr *name)
  {
        const char *dname = ACCESS_ONCE(name->name);
        u32 dlen = ACCESS_ONCE(name->len);
diff --combined fs/fat/namei_vfat.c
index 092b911f5c4ea7c7a9853990c4ba9d28fa8736b0,0335e504e65a619263628f4e01a6d7a0fd80bddc..92b7363dafa95d6a1a529b31f008eb682ad5d047
@@@ -138,10 -138,10 +138,10 @@@ static int vfat_hashi(const struct dent
  /*
   * Case insensitive compare of two vfat names.
   */
- static int vfat_cmpi(const struct dentry *parent, const struct dentry *dentry,
+ static int vfat_cmpi(const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
  {
-       struct nls_table *t = MSDOS_SB(parent->d_sb)->nls_io;
+       struct nls_table *t = MSDOS_SB(dentry->d_sb)->nls_io;
        unsigned int alen, blen;
  
        /* A filename cannot end in '.' or we treat it like it has none */
  /*
   * Case sensitive compare of two vfat names.
   */
- static int vfat_cmp(const struct dentry *parent, const struct dentry *dentry,
+ static int vfat_cmp(const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
  {
        unsigned int alen, blen;
@@@ -652,8 -652,8 +652,8 @@@ out_free
        return err;
  }
  
 -static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir,
 -                        int cluster, struct timespec *ts,
 +static int vfat_add_entry(struct inode *dir, const struct qstr *qname,
 +                        int is_dir, int cluster, struct timespec *ts,
                          struct fat_slot_info *sinfo)
  {
        struct msdos_dir_slot *slots;
@@@ -688,7 -688,7 +688,7 @@@ cleanup
        return err;
  }
  
 -static int vfat_find(struct inode *dir, struct qstr *qname,
 +static int vfat_find(struct inode *dir, const struct qstr *qname,
                     struct fat_slot_info *sinfo)
  {
        unsigned int len = vfat_striptail_len(qname);
diff --combined fs/hfs/hfs_fs.h
index e799ebe71b51aaeec03938b2eb3a73cc43edb741,f28d7a2591058ff29102963ad48f197ff205ed28..16f5172ee40dba88ce1e2027e2e6c4d5a41bfd47
@@@ -178,11 -178,11 +178,11 @@@ extern int hfs_clear_vbm_bits(struct su
  extern int hfs_cat_keycmp(const btree_key *, const btree_key *);
  struct hfs_find_data;
  extern int hfs_cat_find_brec(struct super_block *, u32, struct hfs_find_data *);
 -extern int hfs_cat_create(u32, struct inode *, struct qstr *, struct inode *);
 -extern int hfs_cat_delete(u32, struct inode *, struct qstr *);
 -extern int hfs_cat_move(u32, struct inode *, struct qstr *,
 -                      struct inode *, struct qstr *);
 -extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *);
 +extern int hfs_cat_create(u32, struct inode *, const struct qstr *, struct inode *);
 +extern int hfs_cat_delete(u32, struct inode *, const struct qstr *);
 +extern int hfs_cat_move(u32, struct inode *, const struct qstr *,
 +                      struct inode *, const struct qstr *);
 +extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, const struct qstr *);
  
  /* dir.c */
  extern const struct file_operations hfs_dir_operations;
@@@ -201,7 -201,7 +201,7 @@@ extern int hfs_get_block(struct inode *
  extern const struct address_space_operations hfs_aops;
  extern const struct address_space_operations hfs_btree_aops;
  
 -extern struct inode *hfs_new_inode(struct inode *, struct qstr *, umode_t);
 +extern struct inode *hfs_new_inode(struct inode *, const struct qstr *, umode_t);
  extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *);
  extern int hfs_write_inode(struct inode *, struct writeback_control *);
  extern int hfs_inode_setattr(struct dentry *, struct iattr *);
@@@ -233,11 -233,11 +233,11 @@@ extern const struct dentry_operations h
  extern int hfs_hash_dentry(const struct dentry *, struct qstr *);
  extern int hfs_strcmp(const unsigned char *, unsigned int,
                      const unsigned char *, unsigned int);
- extern int hfs_compare_dentry(const struct dentry *parent, const struct dentry *dentry,
+ extern int hfs_compare_dentry(const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name);
  
  /* trans.c */
 -extern void hfs_asc2mac(struct super_block *, struct hfs_name *, struct qstr *);
 +extern void hfs_asc2mac(struct super_block *, struct hfs_name *, const struct qstr *);
  extern int hfs_mac2asc(struct super_block *, char *, const struct hfs_name *);
  
  /* super.c */
diff --combined fs/hfsplus/hfsplus_fs.h
index 47e009666abdebb39ea2e7b4511ee0d4d875f24b,e95c01f1d62e2392403741d4b2ed7068d0f64acb..a3f03b24746376ddfcb8bac254613334ae4747b9
@@@ -445,17 -445,17 +445,17 @@@ int hfsplus_cat_case_cmp_key(const hfsp
  int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1,
                            const hfsplus_btree_key *k2);
  int hfsplus_cat_build_key(struct super_block *sb, hfsplus_btree_key *key,
 -                         u32 parent, struct qstr *str);
 +                         u32 parent, const struct qstr *str);
  void hfsplus_cat_build_key_with_cnid(struct super_block *sb,
                                     hfsplus_btree_key *key, u32 parent);
  void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms);
  int hfsplus_find_cat(struct super_block *sb, u32 cnid,
                     struct hfs_find_data *fd);
 -int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str,
 +int hfsplus_create_cat(u32 cnid, struct inode *dir, const struct qstr *str,
                       struct inode *inode);
 -int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str);
 -int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, struct qstr *src_name,
 -                     struct inode *dst_dir, struct qstr *dst_name);
 +int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str);
 +int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
 +                     struct inode *dst_dir, const struct qstr *dst_name);
  
  /* dir.c */
  extern const struct inode_operations hfsplus_dir_inode_operations;
@@@ -520,8 -520,7 +520,7 @@@ int hfsplus_uni2asc(struct super_block 
  int hfsplus_asc2uni(struct super_block *sb, struct hfsplus_unistr *ustr,
                    int max_unistr_len, const char *astr, int len);
  int hfsplus_hash_dentry(const struct dentry *dentry, struct qstr *str);
- int hfsplus_compare_dentry(const struct dentry *parent,
-                          const struct dentry *dentry, unsigned int len,
+ int hfsplus_compare_dentry(const struct dentry *dentry, unsigned int len,
                           const char *str, const struct qstr *name);
  
  /* wrapper.c */
diff --combined fs/inode.c
index ad445542c2858f5d622386bb58e725c4c11ae38d,997f537cf3cc3677bb350b453d5e2c5e325471b5..7e3ef3af3db9e35dc175608d83d3e7ab7d3f789a
@@@ -345,7 -345,7 +345,7 @@@ EXPORT_SYMBOL(inc_nlink)
  void address_space_init_once(struct address_space *mapping)
  {
        memset(mapping, 0, sizeof(*mapping));
 -      INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC);
 +      INIT_RADIX_TREE(&mapping->page_tree, GFP_ATOMIC | __GFP_ACCOUNT);
        spin_lock_init(&mapping->tree_lock);
        init_rwsem(&mapping->i_mmap_rwsem);
        INIT_LIST_HEAD(&mapping->private_list);
@@@ -1619,13 -1619,6 +1619,13 @@@ bool atime_needs_update(const struct pa
  
        if (inode->i_flags & S_NOATIME)
                return false;
 +
 +      /* Atime updates will likely cause i_uid and i_gid to be written
 +       * back improprely if their true value is unknown to the vfs.
 +       */
 +      if (HAS_UNMAPPED_ID(inode))
 +              return false;
 +
        if (IS_NOATIME(inode))
                return false;
        if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
@@@ -1729,7 -1722,6 +1729,6 @@@ int dentry_needs_remove_privs(struct de
                mask |= ATTR_KILL_PRIV;
        return mask;
  }
- EXPORT_SYMBOL(dentry_needs_remove_privs);
  
  static int __remove_privs(struct dentry *dentry, int kill)
  {
   */
  int file_remove_privs(struct file *file)
  {
-       struct dentry *dentry = file->f_path.dentry;
-       struct inode *inode = d_inode(dentry);
+       struct dentry *dentry = file_dentry(file);
+       struct inode *inode = file_inode(file);
        int kill;
        int error = 0;
  
        if (IS_NOSEC(inode))
                return 0;
  
-       kill = file_needs_remove_privs(file);
+       kill = dentry_needs_remove_privs(dentry);
        if (kill < 0)
                return kill;
        if (kill)
diff --combined fs/proc/proc_sysctl.c
index ffbb513c06c6482d70bb1037b3640ef5acdcf6b6,30bb00130d0fc156ad6ff13d618c502617a4ed91..1b93650dda2fc5f51cb9c0d42c94efcc2f561a92
@@@ -474,7 -474,7 +474,7 @@@ static struct dentry *proc_sys_lookup(s
  {
        struct ctl_table_header *head = grab_header(dir);
        struct ctl_table_header *h = NULL;
 -      struct qstr *name = &dentry->d_name;
 +      const struct qstr *name = &dentry->d_name;
        struct ctl_table *p;
        struct inode *inode;
        struct dentry *err = ERR_PTR(-ENOENT);
@@@ -834,7 -834,7 +834,7 @@@ static int sysctl_is_seen(struct ctl_ta
        return res;
  }
  
- static int proc_sys_compare(const struct dentry *parent, const struct dentry *dentry,
+ static int proc_sys_compare(const struct dentry *dentry,
                unsigned int len, const char *str, const struct qstr *name)
  {
        struct ctl_table_header *head;
diff --combined include/linux/dcache.h
index accfa1ef072a61aa2501dddd35af837faafea750,107d9abe7166916f43c179e2c6860a607b3c9218..5ff3e9a4fe5f1b3a0ec717a494649d7284bb499f
@@@ -130,7 -130,7 +130,7 @@@ struct dentry_operations 
        int (*d_revalidate)(struct dentry *, unsigned int);
        int (*d_weak_revalidate)(struct dentry *, unsigned int);
        int (*d_hash)(const struct dentry *, struct qstr *);
-       int (*d_compare)(const struct dentry *, const struct dentry *,
+       int (*d_compare)(const struct dentry *,
                        unsigned int, const char *, const struct qstr *);
        int (*d_delete)(const struct dentry *);
        int (*d_init)(struct dentry *);
@@@ -263,7 -263,7 +263,7 @@@ extern void d_rehash(struct dentry *)
   
  extern void d_add(struct dentry *, struct inode *);
  
 -extern void dentry_update_name_case(struct dentry *, struct qstr *);
 +extern void dentry_update_name_case(struct dentry *, const struct qstr *);
  
  /* used for rename() and baskets */
  extern void d_move(struct dentry *, struct dentry *);
diff --combined include/linux/fs.h
index 498255e6914edc41e797852f2e8998b70a503b0c,3f8167a496750e86308bf9d2f66c63752a5a51a9..33f0e96db06f86d9cc7a5d70373b574352f632ad
@@@ -829,6 -829,31 +829,6 @@@ static inline void i_size_write(struct 
  #endif
  }
  
 -/* Helper functions so that in most cases filesystems will
 - * not need to deal directly with kuid_t and kgid_t and can
 - * instead deal with the raw numeric values that are stored
 - * in the filesystem.
 - */
 -static inline uid_t i_uid_read(const struct inode *inode)
 -{
 -      return from_kuid(&init_user_ns, inode->i_uid);
 -}
 -
 -static inline gid_t i_gid_read(const struct inode *inode)
 -{
 -      return from_kgid(&init_user_ns, inode->i_gid);
 -}
 -
 -static inline void i_uid_write(struct inode *inode, uid_t uid)
 -{
 -      inode->i_uid = make_kuid(&init_user_ns, uid);
 -}
 -
 -static inline void i_gid_write(struct inode *inode, gid_t gid)
 -{
 -      inode->i_gid = make_kgid(&init_user_ns, gid);
 -}
 -
  static inline unsigned iminor(const struct inode *inode)
  {
        return MINOR(inode->i_rdev);
@@@ -1295,10 -1320,6 +1295,10 @@@ struct mm_struct
  /* sb->s_iflags */
  #define SB_I_CGROUPWB 0x00000001      /* cgroup-aware writeback enabled */
  #define SB_I_NOEXEC   0x00000002      /* Ignore executables on this fs */
 +#define SB_I_NODEV    0x00000004      /* Ignore devices on this fs */
 +
 +/* sb->s_iflags to limit user namespace mounts */
 +#define SB_I_USERNS_VISIBLE           0x00000010 /* fstype already mounted */
  
  /* Possible states of 'frozen' field */
  enum {
@@@ -1401,13 -1422,6 +1401,13 @@@ struct super_block 
        struct workqueue_struct *s_dio_done_wq;
        struct hlist_head s_pins;
  
 +      /*
 +       * Owning user namespace and default context in which to
 +       * interpret filesystem uids, gids, quotas, device nodes,
 +       * xattrs and security labels.
 +       */
 +      struct user_namespace *s_user_ns;
 +
        /*
         * Keep the lru lists last in the structure so they always sit on their
         * own individual cachelines.
        struct list_head        s_inodes_wb;    /* writeback inodes */
  };
  
 +/* Helper functions so that in most cases filesystems will
 + * not need to deal directly with kuid_t and kgid_t and can
 + * instead deal with the raw numeric values that are stored
 + * in the filesystem.
 + */
 +static inline uid_t i_uid_read(const struct inode *inode)
 +{
 +      return from_kuid(inode->i_sb->s_user_ns, inode->i_uid);
 +}
 +
 +static inline gid_t i_gid_read(const struct inode *inode)
 +{
 +      return from_kgid(inode->i_sb->s_user_ns, inode->i_gid);
 +}
 +
 +static inline void i_uid_write(struct inode *inode, uid_t uid)
 +{
 +      inode->i_uid = make_kuid(inode->i_sb->s_user_ns, uid);
 +}
 +
 +static inline void i_gid_write(struct inode *inode, gid_t gid)
 +{
 +      inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid);
 +}
 +
  extern struct timespec current_fs_time(struct super_block *sb);
  
  /*
@@@ -1599,7 -1588,6 +1599,7 @@@ extern int vfs_whiteout(struct inode *
   */
  extern void inode_init_owner(struct inode *inode, const struct inode *dir,
                        umode_t mode);
 +extern bool may_open_dev(const struct path *path);
  /*
   * VFS FS_IOC_FIEMAP helper definitions.
   */
@@@ -1870,11 -1858,6 +1870,11 @@@ struct super_operations 
  #define IS_WHITEOUT(inode)    (S_ISCHR(inode->i_mode) && \
                                 (inode)->i_rdev == WHITEOUT_DEV)
  
 +static inline bool HAS_UNMAPPED_ID(struct inode *inode)
 +{
 +      return !uid_valid(inode->i_uid) || !gid_valid(inode->i_gid);
 +}
 +
  /*
   * Inode state bits.  Protected by inode->i_lock
   *
@@@ -2023,6 -2006,8 +2023,6 @@@ struct file_system_type 
  #define FS_BINARY_MOUNTDATA   2
  #define FS_HAS_SUBTYPE                4
  #define FS_USERNS_MOUNT               8       /* Can be mounted by userns root */
 -#define FS_USERNS_DEV_MOUNT   16 /* A userns mount does not imply MNT_NODEV */
 -#define FS_USERNS_VISIBLE     32      /* FS must already be visible */
  #define FS_RENAME_DOES_D_MOVE 32768   /* FS will handle d_move() during rename() internally. */
        struct dentry *(*mount) (struct file_system_type *, int,
                       const char *, void *);
  
  #define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
  
 -extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
 -      void *data, int (*fill_super)(struct super_block *, void *, int));
 +extern struct dentry *mount_ns(struct file_system_type *fs_type,
 +      int flags, void *data, void *ns, struct user_namespace *user_ns,
 +      int (*fill_super)(struct super_block *, void *, int));
  extern struct dentry *mount_bdev(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data,
        int (*fill_super)(struct super_block *, void *, int));
@@@ -2065,11 -2049,6 +2065,11 @@@ void deactivate_locked_super(struct sup
  int set_anon_super(struct super_block *s, void *data);
  int get_anon_bdev(dev_t *);
  void free_anon_bdev(dev_t);
 +struct super_block *sget_userns(struct file_system_type *type,
 +                      int (*test)(struct super_block *,void *),
 +                      int (*set)(struct super_block *,void *),
 +                      int flags, struct user_namespace *user_ns,
 +                      void *data);
  struct super_block *sget(struct file_system_type *type,
                        int (*test)(struct super_block *,void *),
                        int (*set)(struct super_block *,void *),
@@@ -2480,13 -2459,12 +2480,13 @@@ extern void init_special_inode(struct i
  extern void make_bad_inode(struct inode *);
  extern bool is_bad_inode(struct inode *);
  
 -#ifdef CONFIG_BLOCK
  static inline bool op_is_write(unsigned int op)
  {
        return op == REQ_OP_READ ? false : true;
  }
  
 +#ifdef CONFIG_BLOCK
 +
  /*
   * return data direction, READ or WRITE
   */
@@@ -2653,7 -2631,6 +2653,7 @@@ extern int do_pipe_flags(int *, int)
  #define __kernel_read_file_id(id) \
        id(UNKNOWN, unknown)            \
        id(FIRMWARE, firmware)          \
 +      id(FIRMWARE_PREALLOC_BUFFER, firmware)  \
        id(MODULE, kernel-module)               \
        id(KEXEC_IMAGE, kexec-image)            \
        id(KEXEC_INITRAMFS, kexec-initramfs)    \
@@@ -2748,11 -2725,6 +2748,6 @@@ extern struct inode *new_inode(struct s
  extern void free_inode_nonrcu(struct inode *inode);
  extern int should_remove_suid(struct dentry *);
  extern int file_remove_privs(struct file *);
- extern int dentry_needs_remove_privs(struct dentry *dentry);
- static inline int file_needs_remove_privs(struct file *file)
- {
-       return dentry_needs_remove_privs(file->f_path.dentry);
- }
  
  extern void __insert_inode_hash(struct inode *, unsigned long hashval);
  static inline void insert_inode_hash(struct inode *inode)
This page took 0.056861 seconds and 5 git commands to generate.