Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3738261rdg; Wed, 18 Oct 2023 04:55:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFvrEDQyzDdBAYO7NWtrssw9deTnjAs9QarY90se0ZF6na6CvIKQmvEl6grmV3ksmouQe+K X-Received: by 2002:a05:6359:a2a:b0:143:9b25:c021 with SMTP id el42-20020a0563590a2a00b001439b25c021mr4522841rwb.1.1697630135935; Wed, 18 Oct 2023 04:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697630135; cv=none; d=google.com; s=arc-20160816; b=CjbCecABTWfeBeXiSRFvID7suRtB+/fw4wQWN/585Dam/fWTZG9iDRD6xe8TXYzb+f n6kYjXCRIcvE1wEq8Z7SZ7shYMV9mVkmF6JqqkR6R2QQFWpCEdsxEAb2tkKa72FyEXyr RR3BlIx0TdHtQaxPJpFX7Aa9OHXVFF6IuJwK9O3WXIsdq4J6qyzn2zl8iP2Z5KY51DhK 5gJZVeNdVBVTu1JIW/lts4CrFMCV0/r8S2L8QSlUlyICuRrfCwj2m3vSBSvqEJC2hXnK Jjvmf/PQLCE836bbdTDCPoBroXYxHL3AH/pByNPi67bdIUaByRi36bQZ8OmF4TGQodJG kkFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=ltXu5Fq3LxiCPsG2MNtqycSoBjGupZgjcbuLMhOBWkE=; fh=wAl1AWdmnu0o2R7pgXlmY5BjbxfMGzbyV8zxJsU7yfE=; b=cVVfpQL4gy8Jzw3EY5kI0lV1wt9v+TThH8LyVHlIVxsRXuQvl+ShAfCq8+y8Nki3/K WG52jbgA6WJOc8uJaZpsd12Jybya8iO0nCvE7BZAIrzUCc277qJzdKVIbTZ1C+zaV3Fn wkfbHMxrM398u7bJlSYNKhGuIRHiXwvbNGDen+VGpg8/lv7RO33tZZmn21lFo0MTIeOn 3xtKuj2Fd+A7p3mNix7od3m06zGFRfVUHsssEORFIEtyYKKC6nnSl4eg6AnQSTPX5Q1F SSBY/a/mEpRm0nhVEP86bEjjUznCOKXVKX9rNc9hmnF3OHFm90aUI1VVpdCdCzSpyFmu /WBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tlWAylwo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h18-20020a056a001a5200b0068e4a646d2csi3877029pfv.252.2023.10.18.04.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 04:55:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tlWAylwo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 662B9807BEE4; Wed, 18 Oct 2023 04:55:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbjJRLzJ (ORCPT + 99 others); Wed, 18 Oct 2023 07:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229846AbjJRLzI (ORCPT ); Wed, 18 Oct 2023 07:55:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D13AD111 for ; Wed, 18 Oct 2023 04:55:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEF67C433C7; Wed, 18 Oct 2023 11:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697630106; bh=kouUTomVRzr7+i4EflHX4+HRDMLMZ32DMLiuSrpZcr4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=tlWAylwoWt9UwBsG6597itkE7ntW1+/H7s9JPrA3jTSumJNKZiz2ZrGbxjxRcUDoq rLE85Z0hQNvClI0CTM/s/mQKQmRQR4aUxflm8V01W77qvbiT06Uaax8kRiot22Gsih wVgE4Urw7D92iNwUUMzNvU2K58b1suqibPJ76hzYTnDoR0O3fXCk2FIcciFFw18ABK VhkBJVfjHCEh2HV1KGzyS0k0cWLeHbxQnQmjCoG88xuZQjC+7Pi729swy5WEdKYFAA xpkaQZGAfFscaRKbUds18xIiCroZcfr//M5wP/7msxi8ubKHEjl0Ekd6Fz0oqgNnsi d/HSQJSVJbxsQ== Message-ID: Subject: Re: [PATCH] fat: fix mtime handing in __fat_write_inode From: Jeff Layton To: Klara Modin Cc: OGAWA Hirofumi , Christian Brauner , Al Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Date: Wed, 18 Oct 2023 07:55:04 -0400 In-Reply-To: References: <20231018-amtime-v1-1-e066bae97285@kernel.org> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 04:55:16 -0700 (PDT) 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 : > >=20 > > Klara reported seeing mangled mtimes when dealing with FAT. Fix the > > braino in the FAT conversion to the new timestamp accessors. > >=20 > > Fixes: e57260ae3226 (fat: convert to new timestamp accessors) > > Reported-by: Klara Modin > > Signed-off-by: Jeff Layton > > --- > > 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. > >=20 > > Christian, this patch should probably be squashed into e57260ae3226. > >=20 > > Thanks! > > Jeff > > --- > > fs/fat/inode.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > 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, i= nt wait) > > raw_entry->size =3D cpu_to_le32(inode->i_size); > > raw_entry->attr =3D fat_make_attrs(inode); > > fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); > > + mtime =3D 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 =3D inode_get_atime(inode); > > __le16 atime; > >=20 > > --- > > base-commit: fea0e8fc7829dc85f82c8a1a8249630f6fb85553 > > change-id: 20231018-amtime-24d2effcc9a9 > >=20 > > Best regards, > > -- > > Jeff Layton > >=20 --=20 Jeff Layton