From patchwork Thu Apr 12 14:20:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 133291 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1738206ljb; Thu, 12 Apr 2018 07:22:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ak7TCyJ47irGorYpSiPWryTH4w3ulbFohJTqYbLkTkKGCTmvZgfLYb827UDBi79b4su81 X-Received: by 2002:a17:902:8a94:: with SMTP id p20-v6mr1303385plo.94.1523542930646; Thu, 12 Apr 2018 07:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523542930; cv=none; d=google.com; s=arc-20160816; b=rP0D7H2dlxjq4Vd0pmf0TkS564UIyB/Ag5pr9go+v8RTEFaqBsx0vLuYiI3sAW/lYC MpEUU1T5z/npIwESDy1P4EoU3bwqJaVKmu2/W/9n6qF50SRwHs+tUsR4IjI8vngImgsj 1feM0f7QnS/sgFjL9nBTJGAu0RqkqMHnokEfDXw5rqNv3AqvkRwlrUn8FCT+MrIY2vBy i3DI//cT790sRIsjYje1ikzQuYOtC/DTBZS7ojMXR900zc6kTGrzTPMifKKfYro9ZI7I 8pDzYe0iPTwRSflU1CY9SO2HU71JEvelK1pThzgZtvLu8s0lCzBnmlJqRvBdK6vbuGwP nt+w== 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=6DByiS1F2CCr2+gB2oGqCiz3xUdZjS7bRr/r9SRF93s=; b=dJ2Lycp2jBYVzvslpjs24M5zvMn3ere07dWPHIL/+oVWwKolCRpo2mvimjku8kFW0D ASZmayvDdHZmtBS44NPnTavSb1Ne4hNbhMeV1fT/F0rbZ2EJWPvmvVlnghP19rNj8Opg 10djuxvKStC2RqvrHowJZHGT98aK6xBJt8zmJBEsLA6+J1fySdX9SB5USKwufi1nw2ox LpCIDGZBw7NloYpmCp4bSuhAnQXptmeMLYr5/SypVnXutWkwk1HUlwVWoiaMsT5ioA28 Cuhjl4dKvyKNH+AYgZlsR3y9UnQiUM2+Aj6QXMr2AxzP/axSwkD5w54E1wz0JkjnENd6 oCuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z13si2149522pfe.197.2018.04.12.07.22.10; Thu, 12 Apr 2018 07:22:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753308AbeDLOU6 (ORCPT + 29 others); Thu, 12 Apr 2018 10:20:58 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:52135 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752965AbeDLOUg (ORCPT ); Thu, 12 Apr 2018 10:20:36 -0400 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0M40t0-1eFLmL0rOU-00rXpg; Thu, 12 Apr 2018 16:20:35 +0200 From: Arnd Bergmann To: y2038@lists.linaro.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann Subject: [PATCH v2 12/13] y2038: ipc: use ktime_get_real_seconds consistently Date: Thu, 12 Apr 2018 16:20:23 +0200 Message-Id: <20180412142024.853892-13-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180412142024.853892-1-arnd@arndb.de> References: <20180412142024.853892-1-arnd@arndb.de> X-Provags-ID: V03:K1:d6Hun3WAu7qxSe9UnY5niAfmpFphUwr7LFNqTeDeFker6GOT9gV jCZKWy5FGIt5zH8/SixzRBxpamWaWSa3zPnNwXde9mF/dRAUpQAQ4dtIaNNOjs/odUtxVYc tKRTezQYMG9bZytFuTM5ALnvaHDGPesodm5yorull3cMfpXadH8593egj3lQXuj33kIcgDP 7lqAypuPzTxTHCVRSdKfA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Ddn6WtrQL9E=:wCpvl1SzqkWWN4X4tqe1Kz jLOb4mZ5QguLdR2R88uLbMA/G4kdkVOPz3uomwmCGmoSqk6+73sfA/WxDk8NGlizEiVnfCaQr VU0BDeEe2oMgDoEMjKgF24LyCvlkGh1k+h70d9514ns5XSe9HDKLiSQMUmQvIOTn+vTR7AALI yiSXrzA+o2bc0v0wUQIj0W9hMrmD4F8IotBXs/4JJ43DIrHW4V2zk9QtCX+Iu5F3RRqpx0BcP R/fT7iWoLOtgPdSbGF3cdG9w3SZaxuGNgQYm4Q5ZCiwPHVqoce4OeXjU2ONiQCpskxIQ8u/Cc fgVytgg84RJstvFxNKtcz9eEH7b6LYxRKseb4wQ/DzY7fMrauWIjTfj4cuGRF9d4X2EUZBs47 8Kn1rRxYyPNNn/gxmHoOxh+ZCqPABNbAx8Mlw1vcn+MMkpQ8dEawUFxad3I9EJkJ36FgxE0Fd VBbaBjjzZpFBq9tbnH6P3Y7/4SXWkiucvy9A7VmxNrO7anGcL62nyrM4Hi9+Y1uXS4CKKRZQs iZA0dSdmJkdS6X5hu7+XVk/ICoW9gs5IseflyKIaYIlnJSJV2qspHJVZop1THLD6bKk7noYSW aAlxeepBSDyy4HPnPv8cYlFRxDGOt1NOMg+8dGOcaLYt9a/kdzBt7Qu7h16Nz/0Iw6gmQqczi m/Z3oFPFVqL8CHFjo61QelkpwaD1RJ1JbnH7cFZMgNduOaLcP7V9EVZb5GCnX2ZVNVJGx0Bv3 oE3TcCa9AU22G0eVJJh0fBC2gSFe8uxTalVAOQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 114a21189613..5422d7c10e9f 100644 --- a/ipc/msg.c +++ b/ipc/msg.c @@ -751,7 +751,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); @@ -852,7 +852,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 */ @@ -1080,7 +1080,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 2994da8ccc7f..579a60265fc6 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(); } }