From patchwork Wed Apr 25 16:03:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 26970 Received: (qmail 59248 invoked by alias); 25 Apr 2018 16:04:50 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 59142 invoked by uid 89); 25 Apr 2018 16:04:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=dfd X-HELO: mout.kundenserver.de From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, tglx@linutronix.de, netdev@vger.kernel.org, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, albert.aribaud@3adev.fr, Peter Zijlstra , Darren Hart , "Eric W. Biederman" , Dominik Brodowski Subject: [PATCH 06/17] y2038: Change sys_utimensat() to use __kernel_timespec Date: Wed, 25 Apr 2018 18:03:00 +0200 Message-Id: <20180425160311.2718314-7-arnd@arndb.de> In-Reply-To: <20180425160311.2718314-1-arnd@arndb.de> References: <20180425160311.2718314-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:WRcSPk41H4s=:aRIUhRdxQKZsyYruZo61Qz yha/TdFPz0PVepEvJd5TQhRAevY+c1N01Ji2yOk0+yUssbPv+G2rebscubmHDcpAKdo7LRR3x uH6JQMzocysQcTFw2atL4Gd4ocljp6MZg592pUf26ByCH+bllIef8M9hoSS6SamXwVnob9TSJ Vay/2cVtNXwNRzXDlneBzcKep9yGP0b42dBL6cXs7NT4TqiLHaHfuOdjnt2t5TqdmviK/78P2 Pm2cJMVu5bHS04h75RXWUBR6uOVLXK8fO1oyX0kN39l4V9yEz4cASHxoJS7fiPVlJANjUf9hd L/H1fIHgBeJMhzGSf9v2NvfAH7lF8h9/u8zNY84Kbsr4K6K1qBlfrVWPANmGEH5EM/QApjxMx RMamj4XL7ycsgZ9iUr0hz9eQKgzhuLBbWFqX+9wobIEqJab0r6GvP97dKHqsJE+UpDJBK5mA3 O3oH2g76bWmezZOIpUUTsgGY85bb1NBceok9TNHBKwrCa/pWggR8RY1DCOMb7qNHTv8nYaNhS MSPGZxUnyJeKhQ2StHBSZlrdORy4F748954B9MwpLsa/1bYzyA2bt5+Ydr3DMMG8v60vh5BTn go9gZdX8C9f1VIx4eSZV59CffAkpz/QtMtHeROvw52w7yqP6jiyGRJuoSyM1NgaYr4XnxlfUd vnBBxA4zxIsLQmB4O5yPFKVkmFZsWU+pgN4PH/cpvUa+/w9/E1anufQirX3rlQnL38Ls= When 32-bit architectures get changed to support 64-bit time_t, utimensat() needs to use the new __kernel_timespec structure as its argument. The older utime(), utimes() and futimesat() system calls don't need a corresponding change as they are no longer used on C libraries that have 64-bit time support. As we do for the other syscalls that have timespec arguments, we reuse the 'compat' syscall entry points to implement the traditional four interfaces, and only leave the new utimensat() as a native handler, so that the same code gets used on both 32-bit and 64-bit kernels on each syscall. Signed-off-by: Arnd Bergmann --- fs/utimes.c | 2 +- include/linux/syscalls.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/utimes.c b/fs/utimes.c index 69d4b6ba1bfb..ca2c02a7985c 100644 --- a/fs/utimes.c +++ b/fs/utimes.c @@ -166,7 +166,7 @@ long do_utimes(int dfd, const char __user *filename, struct timespec64 *times, } SYSCALL_DEFINE4(utimensat, int, dfd, const char __user *, filename, - struct timespec __user *, utimes, int, flags) + struct __kernel_timespec __user *, utimes, int, flags) { struct timespec64 tstimes[2]; diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b92cb79d38c3..3d7dd665cdeb 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -500,7 +500,8 @@ asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr); /* fs/utimes.c */ asmlinkage long sys_utimensat(int dfd, const char __user *filename, - struct timespec __user *utimes, int flags); + struct __kernel_timespec __user *utimes, + int flags); /* kernel/acct.c */ asmlinkage long sys_acct(const char __user *name);