exit/bdflush: Remove the deprecated bdflush system call
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 29 Jun 2021 20:11:44 +0000 (15:11 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 12 Jul 2021 20:17:47 +0000 (15:17 -0500)
The bdflush system call has been deprecated for a very long time.
Recently Michael Schmitz tested[1] and found that the last known
caller of of the bdflush system call is unaffected by it's removal.

Since the code is not needed delete it.

[1] https://lkml.kernel.org/r/36123b5d-daa0-6c2b-f2d4-a942f069fd54@gmail.com
Link: https://lkml.kernel.org/r/87sg10quue.fsf_-_@disp2133
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
20 files changed:
arch/alpha/kernel/syscalls/syscall.tbl
arch/arm/tools/syscall.tbl
arch/arm64/include/asm/unistd32.h
arch/ia64/kernel/syscalls/syscall.tbl
arch/m68k/kernel/syscalls/syscall.tbl
arch/microblaze/kernel/syscalls/syscall.tbl
arch/mips/kernel/syscalls/syscall_o32.tbl
arch/parisc/kernel/syscalls/syscall.tbl
arch/powerpc/kernel/syscalls/syscall.tbl
arch/s390/kernel/syscalls/syscall.tbl
arch/sh/kernel/syscalls/syscall.tbl
arch/sparc/kernel/syscalls/syscall.tbl
arch/x86/entry/syscalls/syscall_32.tbl
arch/xtensa/kernel/syscalls/syscall.tbl
fs/buffer.c
include/linux/syscalls.h
include/uapi/linux/capability.h
kernel/sys_ni.c
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
tools/perf/arch/s390/entry/syscalls/syscall.tbl

index a17687e..7ac22e0 100644 (file)
 259    common  osf_swapctl                     sys_ni_syscall
 260    common  osf_memcntl                     sys_ni_syscall
 261    common  osf_fdatasync                   sys_ni_syscall
-300    common  bdflush                         sys_bdflush
+300    common  bdflush                         sys_ni_syscall
 301    common  sethae                          sys_sethae
 302    common  mount                           sys_mount
 303    common  old_adjtimex                    sys_old_adjtimex
index c5df117..f8a2d5a 100644 (file)
 131    common  quotactl                sys_quotactl
 132    common  getpgid                 sys_getpgid
 133    common  fchdir                  sys_fchdir
-134    common  bdflush                 sys_bdflush
+134    common  bdflush                 sys_ni_syscall
 135    common  sysfs                   sys_sysfs
 136    common  personality             sys_personality
 # 137 was sys_afs_syscall
index 99ffcaf..03d4ca4 100644 (file)
@@ -279,7 +279,7 @@ __SYSCALL(__NR_getpgid, sys_getpgid)
 #define __NR_fchdir 133
 __SYSCALL(__NR_fchdir, sys_fchdir)
 #define __NR_bdflush 134
-__SYSCALL(__NR_bdflush, sys_bdflush)
+__SYSCALL(__NR_bdflush, sys_ni_syscall)
 #define __NR_sysfs 135
 __SYSCALL(__NR_sysfs, sys_sysfs)
 #define __NR_personality 136
index 6d07742..4b20224 100644 (file)
 # 1135 was get_kernel_syms
 # 1136 was query_module
 113    common  quotactl                        sys_quotactl
-114    common  bdflush                         sys_bdflush
+114    common  bdflush                         sys_ni_syscall
 115    common  sysfs                           sys_sysfs
 116    common  personality                     sys_personality
 117    common  afs_syscall                     sys_ni_syscall
index 541bc1b..3ec1291 100644 (file)
 131    common  quotactl                        sys_quotactl
 132    common  getpgid                         sys_getpgid
 133    common  fchdir                          sys_fchdir
-134    common  bdflush                         sys_bdflush
+134    common  bdflush                         sys_ni_syscall
 135    common  sysfs                           sys_sysfs
 136    common  personality                     sys_personality
 # 137 was afs_syscall
index a176fac..9be3ace 100644 (file)
 131    common  quotactl                        sys_quotactl
 132    common  getpgid                         sys_getpgid
 133    common  fchdir                          sys_fchdir
-134    common  bdflush                         sys_bdflush
+134    common  bdflush                         sys_ni_syscall
 135    common  sysfs                           sys_sysfs
 136    common  personality                     sys_personality
 137    common  afs_syscall                     sys_ni_syscall
index 253f2cd..fae3588 100644 (file)
 131    o32     quotactl                        sys_quotactl
 132    o32     getpgid                         sys_getpgid
 133    o32     fchdir                          sys_fchdir
-134    o32     bdflush                         sys_bdflush
+134    o32     bdflush                         sys_ni_syscall
 135    o32     sysfs                           sys_sysfs
 136    o32     personality                     sys_personality                 sys_32_personality
 137    o32     afs_syscall                     sys_ni_syscall
index e26187b..eaf0603 100644 (file)
 131    common  quotactl                sys_quotactl
 132    common  getpgid                 sys_getpgid
 133    common  fchdir                  sys_fchdir
-134    common  bdflush                 sys_bdflush
+134    common  bdflush                 sys_ni_syscall
 135    common  sysfs                   sys_sysfs
 136    32      personality             parisc_personality
 136    64      personality             sys_personality
index aef2a29..6f3953f 100644 (file)
 131    nospu   quotactl                        sys_quotactl
 132    common  getpgid                         sys_getpgid
 133    common  fchdir                          sys_fchdir
-134    common  bdflush                         sys_bdflush
+134    common  bdflush                         sys_ni_syscall
 135    common  sysfs                           sys_sysfs
 136    32      personality                     sys_personality                 ppc64_personality
 136    64      personality                     ppc64_personality
index 64d51ab..aa705e1 100644 (file)
 131  common    quotactl                sys_quotactl                    sys_quotactl
 132  common    getpgid                 sys_getpgid                     sys_getpgid
 133  common    fchdir                  sys_fchdir                      sys_fchdir
-134  common    bdflush                 sys_bdflush                     sys_bdflush
+134  common    bdflush                 sys_ni_syscall                  sys_ni_syscall
 135  common    sysfs                   sys_sysfs                       sys_sysfs
 136  common    personality             sys_s390_personality            sys_s390_personality
 137  common    afs_syscall             -                               -
index e0a70be..7bbd670 100644 (file)
 131    common  quotactl                        sys_quotactl
 132    common  getpgid                         sys_getpgid
 133    common  fchdir                          sys_fchdir
-134    common  bdflush                         sys_bdflush
+134    common  bdflush                         sys_ni_syscall
 135    common  sysfs                           sys_sysfs
 136    common  personality                     sys_personality
 # 137 was afs_syscall
index 603f5a8..f520e9c 100644 (file)
 222    common  delete_module           sys_delete_module
 223    common  get_kernel_syms         sys_ni_syscall
 224    common  getpgid                 sys_getpgid
-225    common  bdflush                 sys_bdflush
+225    common  bdflush                 sys_ni_syscall
 226    common  sysfs                   sys_sysfs
 227    common  afs_syscall             sys_nis_syscall
 228    common  setfsuid                sys_setfsuid16
index ce763a1..a5beae6 100644 (file)
 131    i386    quotactl                sys_quotactl
 132    i386    getpgid                 sys_getpgid
 133    i386    fchdir                  sys_fchdir
-134    i386    bdflush                 sys_bdflush
+134    i386    bdflush                 sys_ni_syscall
 135    i386    sysfs                   sys_sysfs
 136    i386    personality             sys_personality
 137    i386    afs_syscall
index 235d67d..b3d1bc8 100644 (file)
 # 205 was old nfsservctl
 205    common  nfsservctl                      sys_ni_syscall
 206    common  _sysctl                         sys_ni_syscall
-207    common  bdflush                         sys_bdflush
+207    common  bdflush                         sys_ni_syscall
 208    common  uname                           sys_newuname
 209    common  sysinfo                         sys_sysinfo
 210    common  init_module                     sys_init_module
index 6290c3a..32718ee 100644 (file)
@@ -3267,33 +3267,6 @@ out:
 }
 EXPORT_SYMBOL(try_to_free_buffers);
 
-/*
- * There are no bdflush tunables left.  But distributions are
- * still running obsolete flush daemons, so we terminate them here.
- *
- * Use of bdflush() is deprecated and will be removed in a future kernel.
- * The `flush-X' kernel threads fully replace bdflush daemons and this call.
- */
-SYSCALL_DEFINE2(bdflush, int, func, long, data)
-{
-       static int msg_count;
-
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-
-       if (msg_count < 5) {
-               msg_count++;
-               printk(KERN_INFO
-                       "warning: process `%s' used the obsolete bdflush"
-                       " system call\n", current->comm);
-               printk(KERN_INFO "Fix your initscripts?\n");
-       }
-
-       if (func == 1)
-               do_exit(0);
-       return 0;
-}
-
 /*
  * Buffer-head allocation
  */
index 69c9a70..2b47584 100644 (file)
@@ -1158,7 +1158,6 @@ asmlinkage long sys_ustat(unsigned dev, struct ustat __user *ubuf);
 asmlinkage long sys_vfork(void);
 asmlinkage long sys_recv(int, void __user *, size_t, unsigned);
 asmlinkage long sys_send(int, void __user *, size_t, unsigned);
-asmlinkage long sys_bdflush(int func, long data);
 asmlinkage long sys_oldumount(char __user *name);
 asmlinkage long sys_uselib(const char __user *library);
 asmlinkage long sys_sysfs(int option,
index 2ddb422..463d1ba 100644 (file)
@@ -243,7 +243,6 @@ struct vfs_ns_cap_data {
 /* Allow examination and configuration of disk quotas */
 /* Allow setting the domainname */
 /* Allow setting the hostname */
-/* Allow calling bdflush() */
 /* Allow mount() and umount(), setting up new smb connection */
 /* Allow some autofs root ioctls */
 /* Allow nfsservctl */
index 30971b1..cb6f98f 100644 (file)
@@ -416,7 +416,6 @@ COND_SYSCALL(epoll_wait);
 COND_SYSCALL(recv);
 COND_SYSCALL_COMPAT(recv);
 COND_SYSCALL(send);
-COND_SYSCALL(bdflush);
 COND_SYSCALL(uselib);
 
 /* optional: time32 */
index aef2a29..6f3953f 100644 (file)
 131    nospu   quotactl                        sys_quotactl
 132    common  getpgid                         sys_getpgid
 133    common  fchdir                          sys_fchdir
-134    common  bdflush                         sys_bdflush
+134    common  bdflush                         sys_ni_syscall
 135    common  sysfs                           sys_sysfs
 136    32      personality                     sys_personality                 ppc64_personality
 136    64      personality                     ppc64_personality
index 64d51ab..8d619ec 100644 (file)
 131  common    quotactl                sys_quotactl                    sys_quotactl
 132  common    getpgid                 sys_getpgid                     sys_getpgid
 133  common    fchdir                  sys_fchdir                      sys_fchdir
-134  common    bdflush                 sys_bdflush                     sys_bdflush
+134  common    bdflush                 -                               -
 135  common    sysfs                   sys_sysfs                       sys_sysfs
 136  common    personality             sys_s390_personality            sys_s390_personality
 137  common    afs_syscall             -                               -