From patchwork Thu Apr 19 14:37:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133813 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp715114ljf; Thu, 19 Apr 2018 07:39:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/zmezxXxTQdxuXmPgvDnSagw0utYvGmD/I19mWB0xye69Cre9LJcsVa0oX+8fMQwHECQR/ X-Received: by 10.98.210.134 with SMTP id c128mr2093882pfg.240.1524148783707; Thu, 19 Apr 2018 07:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524148783; cv=none; d=google.com; s=arc-20160816; b=mGJ1XzfKGHbwDNidUCw2vWUmNmyptvHY5lCyeD/BYLiq5zXB6SM3kyjlnfHJxXvHQU zyfNtBAlrifXi77uRE15b7Tuqcqj4G3uVTbIDWJCrsz7VQ3glgRLiw0mgNMBsqSCBBEJ hzSUh4LTzGkqDRYvmy3C2aszvoBfm+JCELpq2voUsfHSw+gvgEBiu0wXcP59QgFX96qH wC3cBzHLQlLPdexfmaRvV6VtrAbyjcRGhAe5sN1S75Y/Cvofzbt4O5aRItxdLAKcQ2MO Jbyy3PVXnevIdOkkT5oyhrICD8akB6rcvftix5VyzPCzZBtralU+D0niUC4egihSy1q1 56uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=FNvNZqL1QVz9jPezmoJv0nLyoBHEtt5FGAOH7Fqlq3E=; b=K6XSrcjg/MGpDIcqKE2acppNZAU/9/Cc4bSpA3IYlCH+UJOxsQHFVRcRDLWcP55Fbk asAsTAYvra4ycIz29TzVl6/+hiqePdiCvljGjsqwLzVgFOwmsGLQaoPt9rjgQVvOBMQq 9Pf2JW8D9xhqt0YquQJp/mZbobKiLd6Sek6beHSxp3jIxitELXy57Cbkowa1DZIw1MTd LDsx+QTBXeJT5fM7CvqjCuWtflKuvjmVXNldmLQC8bWLOn3DGd4rYNYCXvEdY3seGuKh gb7cspOd40yalAGPkYrrpJUoGCODCZOR5csQyQlxzQY0WPD8pBY35sAIcX0jp9sOG31J gD2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ycUxVGQ5; spf=pass (google.com: domain of libc-alpha-return-91707-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91707-patch=linaro.org@sourceware.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s10si3067070pgq.162.2018.04.19.07.39.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91707-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ycUxVGQ5; spf=pass (google.com: domain of libc-alpha-return-91707-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91707-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=slzc7XgzpzBZS9+TeJ47iCmY/CQ5Gi/ 3IqwC0UZPHCl6PCGX2zkRo06GpC6P3KLBy7OmVXCL7yauFRF3s1h6h9TifJGlOZt h25LC8UgDk2T3ZaZClDcL0EhRSZKInON3SzwTirQ6e7bcSD+EOZDew6IcrTPGCat 4SWGKAt1seUw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=q9icjhybE9xwgfSYwzjHhuyay+Y=; b=ycUxV GQ5C/whnWj7Jjpke430ZvX45UxV8uVWcWzekp0+IOW1chhamWx0OB5K7dvi3Tu2L h5+xRY+n28mJvhC0IR5jIbOqYDOui5+kLetV10Lz1sax1cSkWb6cs8EhT4luf+Lv SalCSwCQbEhFukz/uujMoiRlnUSybPvhcUBTyA= Received: (qmail 112874 invoked by alias); 19 Apr 2018 14:39:05 -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 112702 invoked by uid 89); 19 Apr 2018 14:39:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 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=alter 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, deepa.kernel@gmail.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, albert.aribaud@3adev.fr, linux-s390@vger.kernel.org, schwidefsky@de.ibm.com, x86@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-mips@linux-mips.org, jhogan@kernel.org, ralf@linux-mips.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org Subject: [PATCH v3 12/17] y2038: ipc: Use ktime_get_real_seconds consistently Date: Thu, 19 Apr 2018 16:37:32 +0200 Message-Id: <20180419143737.606138-13-arnd@arndb.de> In-Reply-To: <20180419143737.606138-1-arnd@arndb.de> References: <20180419143737.606138-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:gamAfTntK3c=:Y84ZIW/sL96pFrxVIiQxKO XNl5i4VA4tAsRztW5MVcW+5deXMPX0mrHYEiLkvXiSj+GTVhULDHEF2GWRr8LMSS/hc6DNHpA IeQzVzt/Ll5oqCYy38voBTLGp25VUAjylYt+SeHGdgH+a57/egjuscZkdYAI+D5XwyluuFr5T Ojl/XSRa8EhSChMa3xqUQZ+dlILqEgsrHNwa8Z39muGttZ/gtjbCL3pAQsGDR8RUjgrU93oKW pFNxje4WDtcrCdEciG7IQ2dzi3Kgp/r0+QhyD0gUVnJtRs7dq/Qtuq9VoSQ3WVpSuqrfNZP0x o0iOBlpHjtaSpQpHMVoxQykWwrba/JqgNVUKZCfEqnOlGK3CMZ5JJvNulR14jB+VKo9I513my GPYV97Bp0D/XkIiDkIPxz86q2f52i25Apbgw/tGf7NhtkbLcBrD/HhJ5rQuhvJaFbb/xANGzc KNL2YOBI5AzAOS+pmXaw5H4Yl2B8mGR6eeo4dTsWwpfn0rucp/KsyZe4METvgRzZKRifZ/Qzq VqR9uPfbb6xwR7zvthg4PjiZoTft/+1hLwivufStEK+ImMs/L5Z1vswGnRxUgARynKUyX4h6m tvt7ZDRocyxgQA7jGpubGxAOaTaYTmYiE47roivgLYT/5Nv9f5PNNhT99xtBkevS3jBtDc61E B4+vGQt3Gg2vlZFmOSpNSsXGSRsHmwoB5hrm02R2B+r59sD79iuCaQ0JFGCwqQTfcSARGPMft 4AverK4XmyzeEH81Wl7xyNo8oeJFWUMt9EYEVw== In some places, we still used get_seconds() instead of ktime_get_real_seconds(), and I'm changing the remaining ones now to all use ktime_get_real_seconds() so we use the full available range for timestamps instead of overflowing the 'unsigned long' return value in year 2106 on 32-bit kernels. Signed-off-by: Arnd Bergmann --- ipc/msg.c | 6 +++--- ipc/sem.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.9.0 diff --git a/ipc/msg.c b/ipc/msg.c index 56fd1c73eedc..574f76c9a2ff 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -758,7 +758,7 @@ static inline int pipelined_send(struct msg_queue *msq, struct msg_msg *msg, WRITE_ONCE(msr->r_msg, ERR_PTR(-E2BIG)); } else { ipc_update_pid(&msq->q_lrpid, task_pid(msr->r_tsk)); - msq->q_rtime = get_seconds(); + msq->q_rtime = ktime_get_real_seconds(); wake_q_add(wake_q, msr->r_tsk); WRITE_ONCE(msr->r_msg, msg); @@ -859,7 +859,7 @@ static long do_msgsnd(int msqid, long mtype, void __user *mtext, } ipc_update_pid(&msq->q_lspid, task_tgid(current)); - msq->q_stime = get_seconds(); + msq->q_stime = ktime_get_real_seconds(); if (!pipelined_send(msq, msg, &wake_q)) { /* no one is waiting for this message, enqueue it */ @@ -1087,7 +1087,7 @@ static long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, in list_del(&msg->m_list); msq->q_qnum--; - msq->q_rtime = get_seconds(); + msq->q_rtime = ktime_get_real_seconds(); ipc_update_pid(&msq->q_lrpid, task_tgid(current)); msq->q_cbytes -= msg->m_ts; atomic_sub(msg->m_ts, &ns->msg_bytes); diff --git a/ipc/sem.c b/ipc/sem.c index 06be75d9217a..c6a8a971769d 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -104,7 +104,7 @@ struct sem { /* that alter the semaphore */ struct list_head pending_const; /* pending single-sop operations */ /* that do not alter the semaphore*/ - time_t sem_otime; /* candidate for sem_otime */ + time64_t sem_otime; /* candidate for sem_otime */ } ____cacheline_aligned_in_smp; /* One sem_array data structure for each set of semaphores in the system. */ @@ -984,10 +984,10 @@ static int update_queue(struct sem_array *sma, int semnum, struct wake_q_head *w static void set_semotime(struct sem_array *sma, struct sembuf *sops) { if (sops == NULL) { - sma->sems[0].sem_otime = get_seconds(); + sma->sems[0].sem_otime = ktime_get_real_seconds(); } else { sma->sems[sops[0].sem_num].sem_otime = - get_seconds(); + ktime_get_real_seconds(); } }