From patchwork Mon Jul 16 16:10:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 142048 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2604229ljj; Mon, 16 Jul 2018 09:12:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpczSnOPLMRq4ZdrkrNPs6XWY3O9JEuH2QajGHOAua20NH9g5rj3E3QEz08Vd322E/TSBhJj X-Received: by 2002:a63:735d:: with SMTP id d29-v6mr16163916pgn.156.1531757531331; Mon, 16 Jul 2018 09:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531757531; cv=none; d=google.com; s=arc-20160816; b=izWvDAbPzIx7SKSlLbwjKiMVc/+Ft3JIyCXDe2+ZNUN7ePJ9/bHJ3S0xX2yZeZjpdL /wTkbtRsQu/Y0Op5IpH3N9Y4h0pcfR+a75iScsA6JRKq403hc3orT/GljyKD66AUYFa/ md1AZLiBBcvlmD3T1Yi2kMjbsKB+sgZL0O+p0xr/552dR+zJWXrrfQCixTxAdW5cD5Cx Jr47i9F5wjRZeqOccqNz3z3tYY37CA0Falw+zH6e4c1hpkJR12Rzi6o9peRhcJzUXGT8 T7UYAVe1q+X2CTJzDcPaIUFEPrRuVtdYyHBSV1y1vC4IcaBjpxOOlllKsqz5hScLN/wI lafg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=TdbG59BJERQtPqW085cha+IE6Iph8whQqO4K1h79yLw=; b=FJc0qJJaWVV/qkdUQIuOujOs+bX0LXpO+ueJAgCAu1nSzdfBy9gfC/Y4j0HOprQH4N VjOa0kvjqbzl6lxwJsrrU5npy2+C0wOQj9veRRXZqIbH4OotRSlvYjGBHZVtguzmFqJ6 5XESsLiMIBZQcRUOsv5iinaS/kRzAyIQzI/SJPPGwGzve/KwO7ebOiTRn5uH4fEItcNR 9V7842rgXeHQsiDePrw0Zj3MgQq8+BNOkGHboxJndzc6DaunU98Sy68QQ5pxg1n+2+9c BH0jFV/gfH5aTu8kDKothjYMyFmFtrJ8i5pr9kgbXUogyMBm/ywexv7SuYxS0LBiQh1q xAbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18-v6si30410996pfh.84.2018.07.16.09.12.11; Mon, 16 Jul 2018 09:12:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731198AbeGPQkP (ORCPT + 10 others); Mon, 16 Jul 2018 12:40:15 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:46517 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730897AbeGPQkP (ORCPT ); Mon, 16 Jul 2018 12:40:15 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0MEx1K-1fqhk12x5e-00FzJE; Mon, 16 Jul 2018 18:11:07 +0200 From: Arnd Bergmann To: tglx@linutronix.de Cc: y2038@lists.linaro.org, hch@infradead.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, albert.aribaud@3adev.fr, netdev@vger.kernel.org, viro@zeniv.linux.org.uk, peterz@infradead.org, dvhart@infradead.org, ebiederm@xmission.com, linux@dominikbrodowski.net, Arnd Bergmann Subject: [PATCH v2 02/17] y2038: Remove newstat family from default syscall set Date: Mon, 16 Jul 2018 18:10:48 +0200 Message-Id: <20180716161103.16239-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180716161103.16239-1-arnd@arndb.de> References: <20180716161103.16239-1-arnd@arndb.de> X-Provags-ID: V03:K1:iZeqkd6MZNuLUWBOU+RaV6nyUfRGDTNt1jV+8bm3IjE4CZuNuL8 bj5f6f3x/o2NcMdiKvJpDyM60CXSZXC/6a3L6mfFuzW3j38yx/CKz1IkWKE4gdXQNnvVY6e W8ropTeQlJVXqu6jb5ww6YfThwHOro8Mg4W2Fis6lNLRkxUWDwLgUL3NmCC76y+W/kCS2w0 teivXOLoPfKmmwufH7KIw== X-UI-Out-Filterresults: notjunk:1; V01:K0:1zNdvRFUY8s=:83xfpb0VrrRrIwbyFQWPwH K9vecdbTrZMZ5ypuUrEwkcuEf9WAkv5zQg/9C9CV+d2ux360tsZD9ckRvyy9HaryjBVnsttRV 724icrTPLxQRNeZBP2aq/n249x6ajlCfqgMAzaKraq5kO314RtGmbKmxmdhCz4O4gbK7dc945 riZ7QLDMzNDfrr5wQrIPgcOAdBLJ9q9FkjSdtXS8shuNNVprXbdFF73wx33V55Rk+53zZy5xm 1ctsrPIT8yj92izFI9gE/An117aE2emoPx8zv9Ed+xSi5TkrkSaqLh7pNnrr4okL0UsBqi3lg WuV/FL4ZGTgxRuGWCcTmvv+gGvevua0y7iWOPurZHFCm4ugvIDAkyK2BkeISTI/AugUwZYV9N v85EiK0L7mC1S7LeNtUpQnlJOBnXmpy5/BZB7Q80TqIHjvfros1+j744Jff77tlremwIQYfxh Mi8L0Hl0v4/OT4yeB9rNfpNe2iyPTPPicTo9Pm+aB67uDm3hT+CJX9tpH02uG0JV81QRLaWV4 nlIBqvbbpfFdzZDPj59bnMU50gKNAcvh+Tf7GlG2hu73n80grEPv2PE/TYukbDmxXeEsJuYki 9xKmSVcsItvmPUrAqcx2UaF7ehBbjs7WehvDTuLPcSxDadv6kADZL7X36bb9yxY9CeESUKxgQ FsfUTJyCw/I11bvVDrRTbOGtkc/rp593YMmyZ9gC7tnGEDZtrQ3ZF+3An5J07XAnoC8g= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We have four generations of stat() syscalls: - the oldstat syscalls that are only used on the older architectures - the newstat family that is used on all 64-bit architectures but lacked support for large files on 32-bit architectures. - the stat64 family that is used mostly on 32-bit architectures to replace newstat - statx() to replace all of the above, adding 64-bit timestamps among other things. We already compile stat64 only on those architectures that need it, but newstat is always built, including on those that don't reference it. This adds a new __ARCH_WANT_NEW_STAT symbol along the lines of __ARCH_WANT_OLD_STAT and __ARCH_WANT_STAT64 to control compilation of newstat. All architectures that need it use an explict define, the others now get a little bit smaller, and future architecture (including 64-bit targets) won't ever see it. Acked-by: Geert Uytterhoeven Signed-off-by: Arnd Bergmann --- arch/alpha/include/asm/unistd.h | 1 + arch/arm/include/asm/unistd.h | 1 + arch/arm64/include/uapi/asm/unistd.h | 1 + arch/ia64/include/asm/unistd.h | 2 ++ arch/m68k/include/asm/unistd.h | 1 + arch/microblaze/include/asm/unistd.h | 1 + arch/mips/include/asm/unistd.h | 1 + arch/parisc/include/asm/unistd.h | 1 + arch/powerpc/include/asm/unistd.h | 1 + arch/s390/include/asm/unistd.h | 1 + arch/sh/include/asm/unistd.h | 1 + arch/sparc/include/asm/unistd.h | 1 + arch/x86/include/asm/unistd.h | 1 + arch/xtensa/include/asm/unistd.h | 1 + fs/stat.c | 3 +++ 15 files changed, 18 insertions(+) -- 2.9.0 diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h index d6e29a1de4cc..edc090470023 100644 --- a/arch/alpha/include/asm/unistd.h +++ b/arch/alpha/include/asm/unistd.h @@ -6,6 +6,7 @@ #define NR_SYSCALLS 523 +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_GETHOSTNAME diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index 076090d2dbf5..07e58010d597 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h @@ -16,6 +16,7 @@ #include #include +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_GETHOSTNAME #define __ARCH_WANT_SYS_PAUSE diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h index 5072cbd15c82..dae1584cf017 100644 --- a/arch/arm64/include/uapi/asm/unistd.h +++ b/arch/arm64/include/uapi/asm/unistd.h @@ -16,5 +16,6 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_NEW_STAT #include diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index ffb705dc9c13..c5b2620c4a4c 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -28,6 +28,8 @@ #define __IGNORE_vfork /* clone() */ #define __IGNORE_umount2 /* umount() */ +#define __ARCH_WANT_NEW_STAT + #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER) #include diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 30d0d3fbd4ef..db22cdadc38a 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h @@ -7,6 +7,7 @@ #define NR_syscalls 380 +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_STAT #define __ARCH_WANT_STAT64 diff --git a/arch/microblaze/include/asm/unistd.h b/arch/microblaze/include/asm/unistd.h index a62d09420a47..a28dc770c9b2 100644 --- a/arch/microblaze/include/asm/unistd.h +++ b/arch/microblaze/include/asm/unistd.h @@ -15,6 +15,7 @@ /* #define __ARCH_WANT_OLD_READDIR */ /* #define __ARCH_WANT_OLD_STAT */ +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_GETHOSTNAME diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h index 3c09450908aa..d7878b3e16d8 100644 --- a/arch/mips/include/asm/unistd.h +++ b/arch/mips/include/asm/unistd.h @@ -24,6 +24,7 @@ #ifndef __ASSEMBLY__ +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_GETHOSTNAME diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index 3d507d04eb4c..b36273bacca7 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h @@ -141,6 +141,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \ } +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_ALARM diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index c19379f0a32e..8b37e01817be 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h @@ -22,6 +22,7 @@ #include #include +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_ALARM diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h index fd79c0d35dc4..1d181373288a 100644 --- a/arch/s390/include/asm/unistd.h +++ b/arch/s390/include/asm/unistd.h @@ -15,6 +15,7 @@ #define __IGNORE_pkey_alloc #define __IGNORE_pkey_free +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_SYS_ALARM #define __ARCH_WANT_SYS_GETHOSTNAME diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h index b36200af9ce7..a845b57eac69 100644 --- a/arch/sh/include/asm/unistd.h +++ b/arch/sh/include/asm/unistd.h @@ -5,6 +5,7 @@ # include # endif +# define __ARCH_WANT_NEW_STAT # define __ARCH_WANT_OLD_READDIR # define __ARCH_WANT_OLD_STAT # define __ARCH_WANT_STAT64 diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h index b2a6a955113e..3544244685e1 100644 --- a/arch/sparc/include/asm/unistd.h +++ b/arch/sparc/include/asm/unistd.h @@ -21,6 +21,7 @@ #else #define __NR_time 231 /* Linux sparc32 */ #endif +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_ALARM diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h index 51c4eee00732..35b66bbf8028 100644 --- a/arch/x86/include/asm/unistd.h +++ b/arch/x86/include/asm/unistd.h @@ -31,6 +31,7 @@ # endif +# define __ARCH_WANT_NEW_STAT # define __ARCH_WANT_OLD_READDIR # define __ARCH_WANT_OLD_STAT # define __ARCH_WANT_SYS_ALARM diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index ed66db3bc9bb..0d532ab60b37 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h @@ -5,6 +5,7 @@ #define __ARCH_WANT_SYS_CLONE #include +#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_UTIME #define __ARCH_WANT_SYS_LLSEEK diff --git a/fs/stat.c b/fs/stat.c index f8e6fb2c3657..adbfcd86c81b 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -280,6 +280,8 @@ SYSCALL_DEFINE2(fstat, unsigned int, fd, struct __old_kernel_stat __user *, stat #endif /* __ARCH_WANT_OLD_STAT */ +#ifdef __ARCH_WANT_NEW_STAT + #if BITS_PER_LONG == 32 # define choose_32_64(a,b) a #else @@ -378,6 +380,7 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf) return error; } +#endif static int do_readlinkat(int dfd, const char __user *pathname, char __user *buf, int bufsiz)