Merge tag 'fsnotify_for_v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Feb 2021 21:23:29 +0000 (13:23 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 22 Feb 2021 21:23:29 +0000 (13:23 -0800)
Pull fsnotify update from Jan Kara:
 "Make inotify groups be charged against appropriate memcgs"

* tag 'fsnotify_for_v5.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  inotify, memcg: account inotify instances to kmemcg

1  2 
fs/notify/fanotify/fanotify_user.c

@@@ -976,7 -976,7 +976,7 @@@ SYSCALL_DEFINE2(fanotify_init, unsigne
                f_flags |= O_NONBLOCK;
  
        /* fsnotify_alloc_group takes a ref.  Dropped in fanotify_release */
-       group = fsnotify_alloc_group(&fanotify_fsnotify_ops);
+       group = fsnotify_alloc_user_group(&fanotify_fsnotify_ops);
        if (IS_ERR(group)) {
                free_uid(user);
                return PTR_ERR(group);
@@@ -1285,23 -1285,26 +1285,23 @@@ fput_and_out
        return ret;
  }
  
 +#ifndef CONFIG_ARCH_SPLIT_ARG64
  SYSCALL_DEFINE5(fanotify_mark, int, fanotify_fd, unsigned int, flags,
                              __u64, mask, int, dfd,
                              const char  __user *, pathname)
  {
        return do_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname);
  }
 +#endif
  
 -#ifdef CONFIG_COMPAT
 -COMPAT_SYSCALL_DEFINE6(fanotify_mark,
 +#if defined(CONFIG_ARCH_SPLIT_ARG64) || defined(CONFIG_COMPAT)
 +SYSCALL32_DEFINE6(fanotify_mark,
                                int, fanotify_fd, unsigned int, flags,
 -                              __u32, mask0, __u32, mask1, int, dfd,
 +                              SC_ARG64(mask), int, dfd,
                                const char  __user *, pathname)
  {
 -      return do_fanotify_mark(fanotify_fd, flags,
 -#ifdef __BIG_ENDIAN
 -                              ((__u64)mask0 << 32) | mask1,
 -#else
 -                              ((__u64)mask1 << 32) | mask0,
 -#endif
 -                               dfd, pathname);
 +      return do_fanotify_mark(fanotify_fd, flags, SC_VAL64(__u64, mask),
 +                              dfd, pathname);
  }
  #endif