From patchwork Mon Oct 1 03:33:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Sorenson X-Patchwork-Id: 10621595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 440B815A7 for ; Mon, 1 Oct 2018 03:33:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C11429239 for ; Mon, 1 Oct 2018 03:33:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D858292C6; Mon, 1 Oct 2018 03:33:58 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 1064D29239 for ; Mon, 1 Oct 2018 03:33:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727735AbeJAKJf (ORCPT ); Mon, 1 Oct 2018 06:09:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6684 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727419AbeJAKJe (ORCPT ); Mon, 1 Oct 2018 06:09:34 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4017155DB; Mon, 1 Oct 2018 03:33:55 +0000 (UTC) Received: from hut.sorensonfamily.com.com (ovpn-116-43.phx2.redhat.com [10.3.116.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1A7A23091886; Mon, 1 Oct 2018 03:33:55 +0000 (UTC) From: Frank Sorenson To: linux-fsdevel@vger.kernel.org Cc: hirofumi@mail.parknet.co.jp Subject: [PATCH V5 0/4] fat: timestamp updates Date: Sun, 30 Sep 2018 22:33:49 -0500 Message-Id: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 01 Oct 2018 03:33:55 +0000 (UTC) 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 fat/msdos timestamps are stored on-disk with several different granularities, some of them lower resolution than timespec64_trunc() can provide. In addition, they are only truncated as they are written to disk, so the timestamps in-memory for new or modified files/directories may be different from the same timestamps after a remount, as the now-truncated times are re-read from the on-disk format. These patches allow finer granularity for the timestamps where possible and add fat-specific ->update_time inode operation and fat_truncate_time functions to truncate each timestamp correctly, giving consistent times across remounts. V5 changes corrected some patch breakage and style issues V4 changes corrected to use fat_truncate_time() and keep mark_inode_dirty() set s_time_gran to 1ns unconditionally add i_version support to update_time() fix atime bug with localtime Frank Sorenson (4): fat: create a function to calculate the timezone offest fat: add functions to update and truncate timestamps appropriately fat: change timestamp updates to use fat_truncate_time fat: truncate inode timestamp updates in setattr fs/fat/dir.c | 2 +- fs/fat/fat.h | 4 +++ fs/fat/file.c | 17 ++++++++-- fs/fat/inode.c | 9 ++++-- fs/fat/misc.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++---- fs/fat/namei_msdos.c | 17 +++++----- fs/fat/namei_vfat.c | 15 +++++---- 7 files changed, 128 insertions(+), 27 deletions(-) Acked-by: OGAWA Hirofumi