From patchwork Wed Apr 25 15:06:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 134340 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp985119lji; Wed, 25 Apr 2018 08:09:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/8wuww1Kc4/W4VFsT/kwAyddza9viC0utH3vlYFRziN+qzPFcm+OfNSO1YJESuvmCB63wZ X-Received: by 2002:a17:902:5ac6:: with SMTP id g6-v6mr28466838plm.262.1524668953487; Wed, 25 Apr 2018 08:09:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524668953; cv=none; d=google.com; s=arc-20160816; b=aKHy2B92u5DlhYqCVIb0h7P6Ybl+znqdU3njScHeN5xr/orWtkqZei3yoili0V96rk KFpI1pqMx9PDI+QBlNn6db+kouqRE376ilOzl5msfeveVAkqOImzxKn29OuNWd441Q13 5a3YT2D6qooRYYLa1Yxq6A+3S43p7qbG9MFLBZHyRjF6VhARRjZkuhF5m+qvokdLrHZs o95m+bhM3082DQNcXb2wXdf6xhFGVlqUSBQmAl/YaaOjBd8QooadLup/wHXzgZG+B4fs E36TxJwd3m7esydrRqQwT66QImqW4wrqOyi/fphvuse5XUdEC0+xIFSwCrLl5fVIytyI UdEg== 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=n5tqN0tq8FCnb5BH6Rqqey1O1h5FmD/4tNt2Z4z5pRfgiSEfiyJbZapitd0FBBDq6Q hRYlwkET6mFJ2mtYSb5f+tSjmccDJYLbF+pveYlImOd1gRZa39X7tktzUdl4V+04Rny5 /IiMlTzqIztsyoafifnAQD8JyLmuElAuPlleTamIlNOhDwPbCR0zYQ6dUMYV95aeeZzU k3mrozcjBXfF3LbZ9L35GkiHNns7+oFAFFicjqkYKzBol6iMsbMfQgZ5UinpmurteFoA DMSUSJo7cLZTSMDsX7yheZuGPmM/DCIEKiAHNXcXpe2KIJr2R1vTQ41OqUTHP2NbbsUE 3ybA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AitX7DX2; spf=pass (google.com: domain of libc-alpha-return-91832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91832-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 v72si16114149pfa.59.2018.04.25.08.09.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 08:09:13 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-91832-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=AitX7DX2; spf=pass (google.com: domain of libc-alpha-return-91832-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-91832-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=MPV+HgVGwX5W5oZ/LrRONhHJpW4zWhy R2iM8xO6nXv8PknjaAB1ZYCkfhMK2KHQ/UgQD7y3ACqbxIxl4LWuHwdvyuvJtx3s bMlelAFNo5N/r5cAW9FN9IU0SgH1S1jNAMm7HoIhdNvwdaU3Pj+30FIs9mY6W/gz +OChQZCT9Bd4= 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=AitX7 DX24YJgDs0BrUAUQD3/k7j3dCRoDEmPO9m7j3dnsUeKMuJMbGrc3dPDyzGLGyu5u RmqWi4h+dteMWTog0/S/P337wMyQLJr8AKTm0yMgJ+2gH4QBoY1XZFeh8VkbVGUD 7SPXdklTVn8Ueya5L9k2GLH+x3HSFgK06wo6bU= Received: (qmail 38642 invoked by alias); 25 Apr 2018 15:07:38 -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 38472 invoked by uid 89); 25 Apr 2018 15:07:37 -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=sem, alter X-HELO: mout.kundenserver.de From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: 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, zackw@panix.com, noloader@gmail.com, Arnd Bergmann Subject: [PATCH v4 12/16] y2038: ipc: Use ktime_get_real_seconds consistently Date: Wed, 25 Apr 2018 17:06:02 +0200 Message-Id: <20180425150606.954771-12-arnd@arndb.de> In-Reply-To: <20180425132242.1500539-1-arnd@arndb.de> References: <20180425132242.1500539-1-arnd@arndb.de> X-UI-Out-Filterresults: notjunk:1; V01:K0:0GSuoYBPUu8=:6g+iRgz4GwUCeThNrGE2z3 e5yCaRxYlrxkQzxmVsoSjSFE42YUQ8t0EWyPkirJ/KVZL311TBsZ1DV5hlPGAiqW1wn6AF2b/ 5pZhWVcEHnwZc3LoOAiv8jOVPGWKqn9vtzFDVh1MILW5P/aI+hgkkAkdUbb/gtZKRJl+T0Sdz IKKUt4m8K6iTVf2PNyuURPbRXpmEKKgDY+Xvg7nD/AInU1yWBl50P6ZHn27pFxabilKMAAMv1 CrTTanhr5fbqdHBWO5pYjuLKu1wImmriVlgOXGb3QeyblAoF1s/bRIkhtUbWcHasOwNYaTDro 74W9zY+f9AkA6NTFOVBoc8GMsQIZjRBcCohGQYZOQEAEMTkBFXXkBQGPD8kn2FVGW0iQP7Nl2 R4HufrR6SgAHOR5wKSqU0gV1Lm9Wn4liVRusifOP/44KOYpT9HnA7vXc/ZoCNZxP1zQUe0qr3 fMiOxINmEDPJpnJscmfHvyK5Nz1Vona6HvPjRCsssd3yFWv8fuymJ5YHrJOe4lGow+QnjrjTw C0jLvEA84OGpeigtHVObbvRvVWXXOrI6iBR2TUVjUMQIdouVlkMAvKW8oG+rkm9KQERRIpzPP hf9JfXuIOqzo6yHu+ism732mxmt3W/Pt/28DpyOLJn9nm2yjJURGqLl2kZSy8YmCl/jW5vtuG vyJj82jleHLbv1ZxYlyLpsgdQxwSHt9mo7QD+zI8Oe3Yu4b0Wl5xfRI6JIuSQma4mLSLKIfzR CRIiPvDtxAIfucxJSDnZi23h4PEwCn0Uz74Riw== 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(); } }