From patchwork Thu Jun 9 05:04:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9166287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C6D3460467 for ; Thu, 9 Jun 2016 05:12:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8C3526490 for ; Thu, 9 Jun 2016 05:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD301282F9; Thu, 9 Jun 2016 05:12:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C67026490 for ; Thu, 9 Jun 2016 05:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946184AbcFIFLN (ORCPT ); Thu, 9 Jun 2016 01:11:13 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36457 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934099AbcFIFFr (ORCPT ); Thu, 9 Jun 2016 01:05:47 -0400 Received: by mail-pf0-f196.google.com with SMTP id 62so2027197pfd.3; Wed, 08 Jun 2016 22:05:47 -0700 (PDT) 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=CZgqv97PB6IsLDoVUL8o1SCjjy48lsEMYeKZfp2WOT4=; b=iKp9fWck5oyzl7mYm9jwp6NaHeCnJmxJWvkc7YloolDMD9dfnXOulTawcMB5/aB1oS 1XeFflgAvPYpTduT7kMbyQCR9Kf5xGaTSpVVEM/FrjiSR3zyuYQKRrbvakTd6Cu63TkA sopktGkzCefpL4jy2YHanOuewVTHT1ZJgNfpqceTAzeuSvXCV/+6wwXIQtdW7+qqLWDf WOJ5VNjN+N+Ti7iSN1BJP0wjqcV8+nNFV0PKqmNCK+KNOVMQRhPo3eU7RQH+xcGCLDsJ 0CJtsF1nzkQBbnFdzncl74ZOfK2bw6td5sQeYAi/XamkwdCy4MRgD1vBxWnh//EBxpbQ 4TvA== 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=CZgqv97PB6IsLDoVUL8o1SCjjy48lsEMYeKZfp2WOT4=; b=BS+bvgMdiqShjK5VRMLAwylltl9opq62pG6mjlFKTcXkAKmHL9HgSFcAAEDzJhc34c CryajIJ8s8L+LKoOiL79wirRcIPxfxAodiOW+YQgxyrN6kEeRjtTmhBUhfUJTeff3oLz tSD3xkTOdTQ1EyqkFugCQ+hWXGKXisTSVik4HzXjiglNxvKn8pRdyHN/mlgEvumAWKxy tmpM3CaejObZ6FONbTGhFdty4q7Mv8P7xl5HBMfa/fuTKbYErkU8IvUW+4BGAJ1HW/OT lBiwsPv7cbqmH/a5Eb4w4IGloupQDjBBE8u7ZfgJeOsRsPeKAatFu9gavm96AfXqNzJ4 cL5A== X-Gm-Message-State: ALyK8tJEEetAE+2PnoPspqjg2JqYRoSMLXnrS7gWzuKOGl9im0P1Qfbfcc4CK0SSAPCxkw== X-Received: by 10.98.200.217 with SMTP id i86mr2592275pfk.130.1465448746813; Wed, 08 Jun 2016 22:05:46 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id 129sm6220808pfe.3.2016.06.08.22.05.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 22:05:46 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Thomas Gleixner , Al Viro , Linus Torvalds , y2038@lists.linaro.org, Jan Kara Subject: [PATCH 06/21] fs: udf: Replace CURRENT_TIME with current_fs_time() Date: Wed, 8 Jun 2016 22:04:50 -0700 Message-Id: <1465448705-25055-7-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465448705-25055-1-git-send-email-deepa.kernel@gmail.com> References: <1465448705-25055-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-Virus-Scanned: ClamAV using ClamSMTP CURRENT_TIME is not y2038 safe. CURRENT_TIME macro is also not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Logical Volume Integrity format is described to have the same timestamp format for "Recording Date and time" as the other [a,c,m]timestamps. Hence using current_fs_time() instead here promises to maintain the same granularity as other timestamps. This is also in preparation for the patch that transitions vfs timestamps to use 64 bit time and hence make them y2038 safe. As part of the effort current_fs_time() will be extended to do range checks. Signed-off-by: Deepa Dinamani Cc: Jan Kara Reviewed-by: Jan Kara --- fs/udf/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/udf/super.c b/fs/udf/super.c index 4942549..482a610 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -1998,7 +1998,7 @@ static void udf_open_lvid(struct super_block *sb) lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; udf_time_to_disk_stamp(&lvid->recordingDateAndTime, - CURRENT_TIME); + current_fs_time(sb)); lvid->integrityType = cpu_to_le32(LVID_INTEGRITY_TYPE_OPEN); lvid->descTag.descCRC = cpu_to_le16( @@ -2030,7 +2030,7 @@ static void udf_close_lvid(struct super_block *sb) mutex_lock(&sbi->s_alloc_mutex); lvidiu->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; lvidiu->impIdent.identSuffix[1] = UDF_OS_ID_LINUX; - udf_time_to_disk_stamp(&lvid->recordingDateAndTime, CURRENT_TIME); + udf_time_to_disk_stamp(&lvid->recordingDateAndTime, current_fs_time(sb)); if (UDF_MAX_WRITE_VERSION > le16_to_cpu(lvidiu->maxUDFWriteRev)) lvidiu->maxUDFWriteRev = cpu_to_le16(UDF_MAX_WRITE_VERSION); if (sbi->s_udfrev > le16_to_cpu(lvidiu->minUDFReadRev))