From patchwork Wed Feb 3 06:07:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8198581 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 88B3FBEEE5 for ; Wed, 3 Feb 2016 06:14:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DE90201BB for ; Wed, 3 Feb 2016 06:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF15A20172 for ; Wed, 3 Feb 2016 06:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933296AbcBCGL0 (ORCPT ); Wed, 3 Feb 2016 01:11:26 -0500 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34629 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756128AbcBCGLV (ORCPT ); Wed, 3 Feb 2016 01:11:21 -0500 Received: by mail-pa0-f65.google.com with SMTP id yy13so510736pab.1; Tue, 02 Feb 2016 22:11:21 -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=FTe2K8Yk2dZeCuBZLm0KPTHYbl//NSJrjLFZxuedm7k=; b=d6mD5APgXDOIei1dfeEqd06R4TDaKzP3UQoMV7jForuX+jpMx5T76ME3Fjq92V9i0P yr84xK1ORqcVRAMvlKUWcxthSMrZLJzmffqEt/EJILKkaMq1rTBIoFjc7UJ29l0L32WR mbGuAQMZ9FPnQ+Pb/gz6+87EkeBb0dOcDrrRsjmD0qTxQkTSi4kkWiLZb8xFFykh4DP0 ZEjCSzV3xlWCCdfFim2SpVugIaqJBnBv1M6LRGyViMiYdwP3m/NIAc8HcNEzMCjJnNDN I9FVcFzCDKuxK1dQPkYJIqk+7vQSPojhV/wCU/TwJu3Fk6n9j0bZSION6odCIxAE8Vlz eKkA== 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=FTe2K8Yk2dZeCuBZLm0KPTHYbl//NSJrjLFZxuedm7k=; b=Tp4ls0mLIMbjTwUAEzo0VYB1PP327eS8UQwbjJ5SpnY2M29+k+mrJGrzf/p4abYkF5 PmcDlunfZtI2ay/gMnnZJD/iMcHkKlTp9wN3str751GGJgy7GseYLaoFwp2EkYCN5Mhm 2J3hza08tTZnwNobjpaSwjVeexiVEZjlNiEFzlU2AfMsXGBUGQ17lNu5IHeX8gqwFvyN SlMxLbnSPwEz66jZs60HwOMyT8BmFo/YNYVhCG/6sP0oATVfoHs4mwftfxv5aTqH2nej lH4ZIkEjK/YFp2D53JPp50nwpGVqqaj0aZIm69KoOHrVA1K5cVX2CbJrLaGeqfTK0Cbe CKKQ== X-Gm-Message-State: AG10YOSv1mAS5Mq+C0ZKBzetXC0ZSyU8FZ/XD5DaSmyeGdoZh/RbiLxHqAOzL1aSCFYOPQ== X-Received: by 10.66.101.36 with SMTP id fd4mr53933312pab.76.1454479881059; Tue, 02 Feb 2016 22:11:21 -0800 (PST) Received: from localhost.localdomain ([106.51.31.224]) by smtp.gmail.com with ESMTPSA id kw10sm6817612pab.0.2016.02.02.22.11.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 22:11:20 -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 03/10] fs: cifs: Replace CURRENT_TIME with current_fs_time() Date: Tue, 2 Feb 2016 22:07:43 -0800 Message-Id: <1454479670-8204-4-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=unavailable 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 CURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_fs_time() instead. Change signature of helper cifs_all_info_to_fattr since it now needs both super_block and cifs_sb_info. Note: The inode timestamps read from the server are assumed to have correct granularity and range. Signed-off-by: Deepa Dinamani Cc: Steve French Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org --- fs/cifs/inode.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index aeb26db..fa72359 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -320,9 +320,8 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb) fattr->cf_mode = S_IFDIR | S_IXUGO | S_IRWXU; fattr->cf_uid = cifs_sb->mnt_uid; fattr->cf_gid = cifs_sb->mnt_gid; - fattr->cf_atime = CURRENT_TIME; - fattr->cf_ctime = CURRENT_TIME; - fattr->cf_mtime = CURRENT_TIME; + fattr->cf_atime = fattr->cf_ctime = + fattr->cf_mtime = current_fs_time(sb); fattr->cf_nlink = 2; fattr->cf_flags |= CIFS_FATTR_DFS_REFERRAL; } @@ -584,9 +583,10 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, /* Fill a cifs_fattr struct with info from FILE_ALL_INFO */ static void cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, - struct cifs_sb_info *cifs_sb, bool adjust_tz, + struct super_block *sb, bool adjust_tz, bool symlink) { + struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); memset(fattr, 0, sizeof(*fattr)); @@ -597,7 +597,7 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info, if (info->LastAccessTime) fattr->cf_atime = cifs_NTtimeToUnix(info->LastAccessTime); else - fattr->cf_atime = CURRENT_TIME; + fattr->cf_atime = current_fs_time(sb); fattr->cf_ctime = cifs_NTtimeToUnix(info->ChangeTime); fattr->cf_mtime = cifs_NTtimeToUnix(info->LastWriteTime); @@ -657,7 +657,6 @@ cifs_get_file_info(struct file *filp) FILE_ALL_INFO find_data; struct cifs_fattr fattr; struct inode *inode = file_inode(filp); - struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); struct cifsFileInfo *cfile = filp->private_data; struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); struct TCP_Server_Info *server = tcon->ses->server; @@ -669,7 +668,7 @@ cifs_get_file_info(struct file *filp) rc = server->ops->query_file_info(xid, tcon, &cfile->fid, &find_data); switch (rc) { case 0: - cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false, + cifs_all_info_to_fattr(&fattr, &find_data, inode->i_sb, false, false); break; case -EREMOTE: @@ -751,7 +750,7 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, } if (!rc) { - cifs_all_info_to_fattr(&fattr, data, cifs_sb, adjust_tz, + cifs_all_info_to_fattr(&fattr, data, sb, adjust_tz, symlink); } else if (rc == -EREMOTE) { cifs_create_dfs_fattr(&fattr, sb);