]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 8 Dec 2019 19:08:28 +0000 (11:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 8 Dec 2019 19:08:28 +0000 (11:08 -0800)
Pull misc vfs cleanups from Al Viro:
 "No common topic, just three cleanups".

* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  make __d_alloc() static
  fs/namespace: add __user to open_tree and move_mount syscalls
  fs/fnctl: fix missing __user in fcntl_rw_hint()

1  2 
fs/dcache.c
fs/fcntl.c
fs/namespace.c

diff --combined fs/dcache.c
index a2749a70023060cbbaa706f0f175ca43b2044ceb,8ede5fa1e32cc60f126039728aa6c2219e2adc6f..b280e07e162b1065203153115f320c77283998d4
@@@ -319,7 -319,7 +319,7 @@@ static inline void __d_set_inode_and_ty
        flags = READ_ONCE(dentry->d_flags);
        flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU);
        flags |= type_flags;
 -      WRITE_ONCE(dentry->d_flags, flags);
 +      smp_store_release(&dentry->d_flags, flags);
  }
  
  static inline void __d_clear_type_and_inode(struct dentry *dentry)
@@@ -903,19 -903,17 +903,19 @@@ struct dentry *dget_parent(struct dentr
  {
        int gotref;
        struct dentry *ret;
 +      unsigned seq;
  
        /*
         * Do optimistic parent lookup without any
         * locking.
         */
        rcu_read_lock();
 +      seq = raw_seqcount_begin(&dentry->d_seq);
        ret = READ_ONCE(dentry->d_parent);
        gotref = lockref_get_not_zero(&ret->d_lockref);
        rcu_read_unlock();
        if (likely(gotref)) {
 -              if (likely(ret == READ_ONCE(dentry->d_parent)))
 +              if (!read_seqcount_retry(&dentry->d_seq, seq))
                        return ret;
                dput(ret);
        }
@@@ -1321,7 -1319,7 +1321,7 @@@ resume
  
                if (!list_empty(&dentry->d_subdirs)) {
                        spin_unlock(&this_parent->d_lock);
 -                      spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_);
 +                      spin_release(&dentry->d_lock.dep_map, _RET_IP_);
                        this_parent = dentry;
                        spin_acquire(&this_parent->d_lock.dep_map, 0, 1, _RET_IP_);
                        goto repeat;
@@@ -1681,7 -1679,7 +1681,7 @@@ EXPORT_SYMBOL(d_invalidate)
   * copied and the copy passed in may be reused after this call.
   */
   
- struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
+ static struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
  {
        struct dentry *dentry;
        char *dname;
diff --combined fs/fcntl.c
index 41b6438bd2d9a8a8ec088b0a6179159c60fae74b,7ca7562f2b79fab25f0c7fcef1de8cbe4eaea2d4..9bc167562ee80bfdcb8b1c6648576e988bbd04eb
@@@ -261,7 -261,7 +261,7 @@@ static int f_getowner_uids(struct file 
  static bool rw_hint_valid(enum rw_hint hint)
  {
        switch (hint) {
 -      case RWF_WRITE_LIFE_NOT_SET:
 +      case RWH_WRITE_LIFE_NOT_SET:
        case RWH_WRITE_LIFE_NONE:
        case RWH_WRITE_LIFE_SHORT:
        case RWH_WRITE_LIFE_MEDIUM:
@@@ -277,7 -277,7 +277,7 @@@ static long fcntl_rw_hint(struct file *
                          unsigned long arg)
  {
        struct inode *inode = file_inode(file);
-       u64 *argp = (u64 __user *)arg;
+       u64 __user *argp = (u64 __user *)arg;
        enum rw_hint hint;
        u64 h;
  
diff --combined fs/namespace.c
index 2adfe7b166a3e214a13ff0417ad341bc25832619,f4529eeca193768263e866fc6d4c15c40d9a9ce6..2fd0c8bcb8c147f28d83ddd883402e8a40a3b7cd
@@@ -2356,7 -2356,7 +2356,7 @@@ static struct file *open_detached_copy(
        return file;
  }
  
- SYSCALL_DEFINE3(open_tree, int, dfd, const char *, filename, unsigned, flags)
+ SYSCALL_DEFINE3(open_tree, int, dfd, const char __user *, filename, unsigned, flags)
  {
        struct file *file;
        struct path path;
@@@ -2478,10 -2478,8 +2478,10 @@@ static void mnt_warn_timestamp_expiry(s
  
                time64_to_tm(sb->s_time_max, 0, &tm);
  
 -              pr_warn("Mounted %s file system at %s supports timestamps until %04ld (0x%llx)\n",
 -                      sb->s_type->name, mntpath,
 +              pr_warn("%s filesystem being %s at %s supports timestamps until %04ld (0x%llx)\n",
 +                      sb->s_type->name,
 +                      is_mounted(mnt) ? "remounted" : "mounted",
 +                      mntpath,
                        tm.tm_year+1900, (unsigned long long)sb->s_time_max);
  
                free_page((unsigned long)buf);
@@@ -2766,11 -2764,14 +2766,11 @@@ static int do_new_mount_fc(struct fs_co
        if (IS_ERR(mnt))
                return PTR_ERR(mnt);
  
 -      error = do_add_mount(real_mount(mnt), mountpoint, mnt_flags);
 -      if (error < 0) {
 -              mntput(mnt);
 -              return error;
 -      }
 -
        mnt_warn_timestamp_expiry(mountpoint, mnt);
  
 +      error = do_add_mount(real_mount(mnt), mountpoint, mnt_flags);
 +      if (error < 0)
 +              mntput(mnt);
        return error;
  }
  
@@@ -3514,8 -3515,8 +3514,8 @@@ err_fsfd
   * Note the flags value is a combination of MOVE_MOUNT_* flags.
   */
  SYSCALL_DEFINE5(move_mount,
-               int, from_dfd, const char *, from_pathname,
-               int, to_dfd, const char *, to_pathname,
+               int, from_dfd, const char __user *, from_pathname,
+               int, to_dfd, const char __user *, to_pathname,
                unsigned int, flags)
  {
        struct path from_path, to_path;