From patchwork Wed Sep 26 22:43:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Sorenson X-Patchwork-Id: 10617005 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 8019413A4 for ; Wed, 26 Sep 2018 22:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EC0E2B202 for ; Wed, 26 Sep 2018 22:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FC222B6D8; Wed, 26 Sep 2018 22:43:40 +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 3D0CF2B202 for ; Wed, 26 Sep 2018 22:43:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbeI0E6t (ORCPT ); Thu, 27 Sep 2018 00:58:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38606 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbeI0E6t (ORCPT ); Thu, 27 Sep 2018 00:58:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 704B44E4E6; Wed, 26 Sep 2018 22:43:38 +0000 (UTC) Received: from hut.sorensonfamily.com.com (ovpn-116-190.phx2.redhat.com [10.3.116.190]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9B724611C6; Wed, 26 Sep 2018 22:43:37 +0000 (UTC) From: Frank Sorenson To: linux-fsdevel@vger.kernel.org Cc: hirofumi@mail.parknet.co.jp Subject: [PATCH V4 0/4] fat: timestamp updates Date: Wed, 26 Sep 2018 17:43:31 -0500 Message-Id: <20180926224335.5919-1-sorenson@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 26 Sep 2018 22:43:38 +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. 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 | 2 ++ 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, 126 insertions(+), 27 deletions(-)