From patchwork Wed Feb 3 06:07:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8198561 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DDB8B9F4DD for ; Wed, 3 Feb 2016 06:14:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1385B201BB for ; Wed, 3 Feb 2016 06:14:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3702B20172 for ; Wed, 3 Feb 2016 06:14:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756138AbcBCGLn (ORCPT ); Wed, 3 Feb 2016 01:11:43 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36307 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753028AbcBCGLl (ORCPT ); Wed, 3 Feb 2016 01:11:41 -0500 Received: by mail-pf0-f193.google.com with SMTP id n128so535548pfn.3; Tue, 02 Feb 2016 22:11:40 -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=NsiywmLLRzlBpTgmOgf4AJmygDtTrP52GLDV6hf4IGo=; b=x5N2h6rTJDdnFYDSk+kwZSdTrZF+l+NTAgY+ivtP/cgRyMHJyDCp1pStsYOJPO/xmP cTEvXvoE9m/+I1PW6mRopvR3iZYR3V7R8L+oQjxkSPsTtANLvx2aNJ4PAamQYpOZbpWS ldKe6fEOgdNscIxYrkcM5YjnoTVIg8dAw4D2mJhHacxA/fMRTJAJ96Y0I01/j26oXT7l /IAiz9AVGGqSaaSV3n8lVc2b7CKPt2aSrBQX4lTbP+R6Mk+uwqU0WtcNOv268ZzpaEyW 2uvnODgGZh3UpS0f5cQ9TANcduWwGP+PHt2UQD6lZsx/fGNGjhs2PBg+Y76/6Ey5P+5M Rm+w== 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=NsiywmLLRzlBpTgmOgf4AJmygDtTrP52GLDV6hf4IGo=; b=VbdH2yLYHtlc8c4WNqIcdN/dNXBs1e06GL4F+h+Qhcim3et8c90RpbEzR0OYwuOXsy wGMBUo1S/6Ay7+qnZETs8kdZdJ8kd0esBO4yWI79HW6EGAFjNCjHIXftEZzOrbU44kIP TGpQ/aLeyuLrdsAobQ9YpbvwcotBbFM62LgAGHlybE4qezMli/8uub+kMZ9xVgtlZg+u /8dH7Blx53hwjAHqsrOFuru8uxI8AcSTuYdARJS3MgS+hWx5II2ht16+fWaKNKx//elC eHIYBMoA8/uqTs8leRU9nQFhgC8JGJh5w1f92c/whadbRfOF8g1E4qbs25S/p1qkTzrg oA0Q== X-Gm-Message-State: AG10YORK7izsEvo3w5cnj3V0zNeG4qQ9BNyIrBPXFsZv/73shfiW5LvFF1SSaawRKQQxvg== X-Received: by 10.98.73.8 with SMTP id w8mr35327267pfa.106.1454479900570; Tue, 02 Feb 2016 22:11:40 -0800 (PST) Received: from localhost.localdomain ([106.51.31.224]) by smtp.gmail.com with ESMTPSA id kw10sm6817612pab.0.2016.02.02.22.11.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 22:11:40 -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, Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH 04/10] fs: cifs: Replace CURRENT_TIME with ktime_get_real_ts() Date: Tue, 2 Feb 2016 22:07:44 -0800 Message-Id: <1454479670-8204-5-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com> References: <1454479670-8204-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=-7.2 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 This is in preparation for the series that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe. CURRENT_TIME macro will be deleted before merging the aforementioned series. Filesystem times will use current_fs_time() instead of CURRENT_TIME. Use ktime_get_real_ts() here as this is not filesystem time. ktime_get_real_ts() returns the timestamp in ns which can be used to calculate network time for NTLMv2 authentication timestamp. Signed-off-by: Deepa Dinamani Cc: Steve French Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org --- fs/cifs/cifsencrypt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index d411654..f86e07d 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -460,6 +460,7 @@ find_timestamp(struct cifs_ses *ses) unsigned char *blobptr; unsigned char *blobend; struct ntlmssp2_name *attrptr; + struct timespec ts; if (!ses->auth_key.len || !ses->auth_key.response) return 0; @@ -484,7 +485,8 @@ find_timestamp(struct cifs_ses *ses) blobptr += attrsize; /* advance attr value */ } - return cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME)); + ktime_get_real_ts(&ts); + return cpu_to_le64(cifs_UnixTimeToNT(ts)); } static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,