From patchwork Fri Feb 12 09:35:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8289521 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 27A94BEEE5 for ; Fri, 12 Feb 2016 09:40:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18422203B7 for ; Fri, 12 Feb 2016 09:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1347F203B5 for ; Fri, 12 Feb 2016 09:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751792AbcBLJgs (ORCPT ); Fri, 12 Feb 2016 04:36:48 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36671 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751684AbcBLJgp (ORCPT ); Fri, 12 Feb 2016 04:36:45 -0500 Received: by mail-pa0-f53.google.com with SMTP id yy13so44156076pab.3; Fri, 12 Feb 2016 01:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9Ubvh3OqjC8WC5X9Ao8mL4NbGSeI9VUcRoIc1Ej5dog=; b=PfOVzEsk+RgCLMXRfjeT9tesayMn39w/Ti+lvMxE5nNFJis8Ws8Fa18jFURTJtNIm2 VNZBIbwtHlIoFeVZHJkaMa29q+uSSwsplBfBKDlI3qJNRrchAhPHG0/pQFA2K9e3MOxY NQe4vDT1+OEtQlFIWrLdCoctnT9dORXd1fxy9eyMLeKD+jHqYxV/nFi0XVVtjDIhZHYA NNxGIj8ab3FBDPmYvFoNyCC8vW2RzBBM78ukVY0jvdbIZhEsGfrTN+aYmZ4C4ArDowK4 0Gu4nrkNDp0HRJhfpoW754wX4MzsBV2crWnDr47IcnDU3G5gz+5jcbuYLb1bxD6Cl6Sl OTFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9Ubvh3OqjC8WC5X9Ao8mL4NbGSeI9VUcRoIc1Ej5dog=; b=cbVJJ93F3WTHlS0A6uFi8SEi0WoMsxG9X4bnwA/bIKiXyytvTzwzv2hnM+0Old45dI i7JsvKJ2bEYpfDSB8r4MG3FPpYrhArXKFX4LLvAWTPXEr5PGqJBLdqVlz6BewbNQLTyQ Flld5I+7cGw7IGIKfoX2B8xs3FbfIj9IAfbXOlyLTiz5vjVUJIhr1EbbygSxNr5jCy3F Bw9rxLDZJBbWofe6xgm4p4lKqw8CEahP695HnIUbH48kRRu2/a514tgKE+v7ZldndWh3 R02wZTXzYye9/ue617WNDT8QJu6co8QWXIdzTaU9mSSoYdJCv0IjRbCV4R0NgxYraiTR uERg== X-Gm-Message-State: AG10YORphyNMjgQYeklPZZRCD9j7uYJJG/k7eb1FHcVukvjJ1sUE9SWF8tDCPbY3QGVx1Q== X-Received: by 10.66.161.66 with SMTP id xq2mr587870pab.153.1455269805163; Fri, 12 Feb 2016 01:36:45 -0800 (PST) Received: from localhost.localdomain ([106.51.31.162]) by smtp.gmail.com with ESMTPSA id g25sm17972250pfg.35.2016.02.12.01.36.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Feb 2016 01:36:44 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: Arnd Bergmann , Dave Chinner , "Theodore Ts'o" , linux-kernel@vger.kernel.org Subject: [RFC v2a 05/12] fs: cifs: Use vfs_time_get_real_* time functions Date: Fri, 12 Feb 2016 01:35:59 -0800 Message-Id: <1455269766-2994-6-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455269766-2994-1-git-send-email-deepa.kernel@gmail.com> References: <20160212092153.GA2368@deepa-ubuntu> <1455269766-2994-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The VFS inode timestamps are not y2038 safe as they use struct timespec. These will be changed to use struct timespec64 instead and that is y2038 safe. But, since the above data type conversion will break the end file systems, use vfs_time aliases here to access inode times. Variables in the patch are passed into functions that also take inode times as argument. Hence, using vfs_time aliases here is necessary so that they can change to use 64 bit time along with vfs. Signed-off-by: Deepa Dinamani --- fs/cifs/cifsencrypt.c | 2 +- fs/cifs/cifssmb.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index ee1e674..2b606e2 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -485,7 +485,7 @@ find_timestamp(struct cifs_ses *ses) blobptr += attrsize; /* advance attr value */ } - ktime_get_real_ts(&ts); + vfs_get_real_ts(&ts); return cpu_to_le64(cifs_UnixTimeToNT(ts)); } diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index b3b3fa4..4c1deae 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -479,11 +479,11 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr) */ int val, seconds, remain, result; struct vfs_time ts; - unsigned long utc = get_seconds(); + unsigned long long utc = vfs_get_real_seconds(); ts = cnvrtDosUnixTm(rsp->SrvTime.Date, rsp->SrvTime.Time, 0); - cifs_dbg(FYI, "SrvTime %d sec since 1970 (utc: %d) diff: %d\n", - (int)ts.tv_sec, (int)utc, + cifs_dbg(FYI, "SrvTime %lld sec since 1970 (utc: %lld) diff: %d\n", + (long long)ts.tv_sec, (long long)utc, (int)(utc - ts.tv_sec)); val = (int)(utc - ts.tv_sec); seconds = abs(val);