Message ID | 20231018-amtime-v1-1-e066bae97285@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4714078vqb; Wed, 18 Oct 2023 04:16:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2LsLnOO607ZsTPd+dUcIN1cKycHziVDY6n5fSVtfCmTttlP7EzrqC+97koEzuvhNLewdg X-Received: by 2002:a05:6a20:f387:b0:17b:170c:2d11 with SMTP id qr7-20020a056a20f38700b0017b170c2d11mr3418246pzb.6.1697627764346; Wed, 18 Oct 2023 04:16:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697627764; cv=none; d=google.com; s=arc-20160816; b=zX3LyY8HwRbbivVV/nYQEsgP0QXxNvLX/9hcL9s7KF8kr/fIgkRG7+hdsgwGRjb3qg 7Bsy+fibrhi8lsVr1xBmUsHCQEVyNd6z+7vpLXxxgQYmnuy/Wc37VA2HFi97YCCktVqq 70a02nt8XuxEU4cXzUZuC/CPfZGjq/mbNTyXSzRLLJ7xqz9HzkxKP2DW9lKa4aZn+AX2 EDdwzmRbSO8UgiEU6uuhK5SRWpT0wy7yWwBksKIOefieXr3SziKBWitY6aJs07+iPQjg sDu4Kc6kLg3oc8Tu2uUzesHYKXAFUSWwaB9VNLfWAZ/5J4lLS8ksBXYPMDichBwiyaPG 175Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=xUthe6zUmAXvxe/MSm29ubleWpZmt12ShLurb57os6E=; fh=8GR2xlAALNcXb95ltIySU8dk6BkQSa3lYxIThRtxVCM=; b=vAWEhDw2PNEbfuu0qGNauVeVYvoxllNgKwD2uDxJGgr9odcdPYTZCHLXN5Otmb8Rn3 hc0ZkNV9bSOoekJ28SWP66BYj3sdszx5qw6sIhZ22JXqAoZFm1IjMsm8SXCudtX1kFCK rR9L4fe6+QrsLEjAFXaqx9MZaR/3UFhMXh1MLV2ruXOL75CrHjEiLW5zZx5y5JsJ6Sdr wqMDkwR/xbbEtIFzGY9UPwDqi8MrThipF/peyhk998qDQrIMw0uQOx0D17tKEiQighaP pH8VpwRSSUNkYDB3dt+qOzJ8oVG0BhTFdxEysAPPqiGDT0DzUcpkatNFBWWh/efhr1dQ EhaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CDx6kAC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b22-20020a639316000000b0057c7341d568si1906612pge.645.2023.10.18.04.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 04:16:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CDx6kAC4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id BAB7E8114EF8; Wed, 18 Oct 2023 04:16:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjJRLPu (ORCPT <rfc822;lkml4gm@gmail.com> + 24 others); Wed, 18 Oct 2023 07:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229986AbjJRLPr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Oct 2023 07:15:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F33111 for <linux-kernel@vger.kernel.org>; Wed, 18 Oct 2023 04:15:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E387BC433C7; Wed, 18 Oct 2023 11:15:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697627744; bh=eqnb/qNu51ZmgB//9K6h6NWc3AFRVlk3BSEB6pAXkJ8=; h=From:Date:Subject:To:Cc:From; b=CDx6kAC4XqX3kYRnRTuuUydj0qo9JpnZCSEtNIzTaMtJFPxa1GPjkX/IvRPXTCvwl N3CY/Hmb4NWoPaZEtwk8ZFHkD7jmHd7mgOBM/Rx+xO3xblf74JO+arjs8HxadGlLnd CQeuYj3sdm4/fis401LI6lYeiBmeLlOo8VFHO2UlucRMsnRcFfwIqeTfQ8UuVshmyE Mlj60cqHThFagDSlEGcdsjN3vD4JdkXB5jTa6IDHoYv5zjW9CJ9wczI3J0wiMCrHZp a50DbIuU42cSw0SsuVr7Na8mm1rqGFFySRuqhrpj0KEqhxj4gfqpK1T89b/IPifwsp ZhK7YjfJ2awCg== From: Jeff Layton <jlayton@kernel.org> Date: Wed, 18 Oct 2023 07:15:40 -0400 Subject: [PATCH] fat: fix mtime handing in __fat_write_inode MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231018-amtime-v1-1-e066bae97285@kernel.org> X-B4-Tracking: v=1; b=H4sIAFu+L2UC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDI2NDA0ML3cTckszcVF0jkxSj1LS05GTLREsloOKCotS0zAqwQdGxtbUA9I1 pHVgAAAA= To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>, Klara Modin <klarasmodin@gmail.com>, Christian Brauner <brauner@kernel.org>, Al Viro <viro@zeniv.linux.org.uk> Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jeff Layton <jlayton@kernel.org> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1412; i=jlayton@kernel.org; h=from:subject:message-id; bh=eqnb/qNu51ZmgB//9K6h6NWc3AFRVlk3BSEB6pAXkJ8=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBlL75fXmq2zfmW9Xdd8xNXSSW99pSGmhSQR6U+O hQcUHf+coKJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZS++XwAKCRAADmhBGVaC FX6WEAC9nKhANczujf31/07xncKpeHmV409EfIwvIg1jL4PHEy18gcKqdqTpQ2egNKuac2M3cZv nAc06PMwTaGEPYqJCxkz/dEON5QGFwyPmsctCPUNcyPGO3vMalxYUaZWA2tkokAD0QTmVB7sZol 5IqjybIKcdYk63ezrNb1RMlyYPh0iDoRVC3t4Mqjn6Jls9Fwd7b/htLJoXIwlCvY3dlmdi9vWmQ +29uYoLTx6Rxr1f0nQUYi0rWn7w6vHOqIe6o79rMngbhAEXbWqcZ5ed6s4wctGyNa5q+3m1vFfD A7iqYWAMSJ7XxTX9VEgAFlDEj6CGwfHrwy1YLGfjGIuNt4q1OQt0rZ5QfoMoOPizmnmTakDwVrB 50Nc0tDj421CAdtk0k1YIusgMY5TH5s46EcoyZaUK2SEC/dBkvg64DLPz3gEtoPQl3RjUWYKbtG ZQOzh1Q3AEjf/aoM9HsdxiSh5l9WWAVxnkhF+VSrnXEAn7yNK4AM/IE48uf8ne6VJ86Al1rWXxQ 0y8UVhM2jpG++mEpnrJPPed9tDqHJ/9b31w/zulnB3T01zGhJxetuxL4scm+Scb/h9on5JwNvaf vV2vrcEXCPBLZ8ET4WcWvPSU5FKdoTs+M0rPferF/vNc+rwi/KfiWOyRp7h9pPtcikoio/WGZ6m 9JbdIyfGlBoM+YQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 04:16:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780091730733908684 X-GMAIL-MSGID: 1780091730733908684 |
Series |
fat: fix mtime handing in __fat_write_inode
|
|
Commit Message
Jeff Layton
Oct. 18, 2023, 11:15 a.m. UTC
Klara reported seeing mangled mtimes when dealing with FAT. Fix the
braino in the FAT conversion to the new timestamp accessors.
Fixes: e57260ae3226 (fat: convert to new timestamp accessors)
Reported-by: Klara Modin <klarasmodin@gmail.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
This patch fixes the bug that Klara reported late yesterday. The issue
is a bad by-hand conversion of __fat_write_inode to the new timestamp
accessor functions.
Christian, this patch should probably be squashed into e57260ae3226.
Thanks!
Jeff
---
fs/fat/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: fea0e8fc7829dc85f82c8a1a8249630f6fb85553
change-id: 20231018-amtime-24d2effcc9a9
Best regards,
Comments
On Wed, 18 Oct 2023 07:15:40 -0400, Jeff Layton wrote: > Klara reported seeing mangled mtimes when dealing with FAT. Fix the > braino in the FAT conversion to the new timestamp accessors. > > Thanks for the quick fix! Folded into "fat: convert to new timestamp accessors" as requested. --- Applied to the vfs.ctime branch of the vfs/vfs.git tree. Patches in the vfs.ctime branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.ctime [1/1] fat: convert to new timestamp accessors https://git.kernel.org/vfs/vfs/c/07b7351751a8
I can confirm that this patch fixes the issue, thanks! Den ons 18 okt. 2023 kl 13:15 skrev Jeff Layton <jlayton@kernel.org>: > > Klara reported seeing mangled mtimes when dealing with FAT. Fix the > braino in the FAT conversion to the new timestamp accessors. > > Fixes: e57260ae3226 (fat: convert to new timestamp accessors) > Reported-by: Klara Modin <klarasmodin@gmail.com> > Signed-off-by: Jeff Layton <jlayton@kernel.org> > --- > This patch fixes the bug that Klara reported late yesterday. The issue > is a bad by-hand conversion of __fat_write_inode to the new timestamp > accessor functions. > > Christian, this patch should probably be squashed into e57260ae3226. > > Thanks! > Jeff > --- > fs/fat/inode.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/fat/inode.c b/fs/fat/inode.c > index aa87f323fd44..1fac3dabf130 100644 > --- a/fs/fat/inode.c > +++ b/fs/fat/inode.c > @@ -888,9 +888,9 @@ static int __fat_write_inode(struct inode *inode, int wait) > raw_entry->size = cpu_to_le32(inode->i_size); > raw_entry->attr = fat_make_attrs(inode); > fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); > + mtime = inode_get_mtime(inode); > fat_time_unix2fat(sbi, &mtime, &raw_entry->time, > &raw_entry->date, NULL); > - inode_set_mtime_to_ts(inode, mtime); > if (sbi->options.isvfat) { > struct timespec64 ts = inode_get_atime(inode); > __le16 atime; > > --- > base-commit: fea0e8fc7829dc85f82c8a1a8249630f6fb85553 > change-id: 20231018-amtime-24d2effcc9a9 > > Best regards, > -- > Jeff Layton <jlayton@kernel.org> >
Many thanks for the bug report and testing! Do you mind if we add your Tested-by: for this patch? Thanks! Jeff On Wed, 2023-10-18 at 13:44 +0200, Klara Modin wrote: > I can confirm that this patch fixes the issue, thanks! > > Den ons 18 okt. 2023 kl 13:15 skrev Jeff Layton <jlayton@kernel.org>: > > > > Klara reported seeing mangled mtimes when dealing with FAT. Fix the > > braino in the FAT conversion to the new timestamp accessors. > > > > Fixes: e57260ae3226 (fat: convert to new timestamp accessors) > > Reported-by: Klara Modin <klarasmodin@gmail.com> > > Signed-off-by: Jeff Layton <jlayton@kernel.org> > > --- > > This patch fixes the bug that Klara reported late yesterday. The issue > > is a bad by-hand conversion of __fat_write_inode to the new timestamp > > accessor functions. > > > > Christian, this patch should probably be squashed into e57260ae3226. > > > > Thanks! > > Jeff > > --- > > fs/fat/inode.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/fat/inode.c b/fs/fat/inode.c > > index aa87f323fd44..1fac3dabf130 100644 > > --- a/fs/fat/inode.c > > +++ b/fs/fat/inode.c > > @@ -888,9 +888,9 @@ static int __fat_write_inode(struct inode *inode, int wait) > > raw_entry->size = cpu_to_le32(inode->i_size); > > raw_entry->attr = fat_make_attrs(inode); > > fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); > > + mtime = inode_get_mtime(inode); > > fat_time_unix2fat(sbi, &mtime, &raw_entry->time, > > &raw_entry->date, NULL); > > - inode_set_mtime_to_ts(inode, mtime); > > if (sbi->options.isvfat) { > > struct timespec64 ts = inode_get_atime(inode); > > __le16 atime; > > > > --- > > base-commit: fea0e8fc7829dc85f82c8a1a8249630f6fb85553 > > change-id: 20231018-amtime-24d2effcc9a9 > > > > Best regards, > > -- > > Jeff Layton <jlayton@kernel.org> > >
Den ons 18 okt. 2023 kl 13:55 skrev Jeff Layton <jlayton@kernel.org>: > > Many thanks for the bug report and testing! Do you mind if we add your > Tested-by: for this patch? > Not at all, please do. Thanks, Tested-by: Klara Modin <klarasmodin@gmail.com>
On Wed, Oct 18, 2023 at 02:03:11PM +0200, Klara Modin wrote: > Den ons 18 okt. 2023 kl 13:55 skrev Jeff Layton <jlayton@kernel.org>: > > > > Many thanks for the bug report and testing! Do you mind if we add your > > Tested-by: for this patch? > > > Not at all, please do. > > Thanks, > Tested-by: Klara Modin <klarasmodin@gmail.com> Added, thanks!
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index aa87f323fd44..1fac3dabf130 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -888,9 +888,9 @@ static int __fat_write_inode(struct inode *inode, int wait) raw_entry->size = cpu_to_le32(inode->i_size); raw_entry->attr = fat_make_attrs(inode); fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); + mtime = inode_get_mtime(inode); fat_time_unix2fat(sbi, &mtime, &raw_entry->time, &raw_entry->date, NULL); - inode_set_mtime_to_ts(inode, mtime); if (sbi->options.isvfat) { struct timespec64 ts = inode_get_atime(inode); __le16 atime;