* [PATCH] fat: fix mtime handing in __fat_write_inode
@ 2023-10-18 11:15 Jeff Layton
2023-10-18 11:27 ` Christian Brauner
2023-10-18 11:44 ` Klara Modin
0 siblings, 2 replies; 6+ messages in thread
From: Jeff Layton @ 2023-10-18 11:15 UTC (permalink / raw)
To: OGAWA Hirofumi, Klara Modin, Christian Brauner, Al Viro
Cc: linux-kernel, linux-fsdevel, Jeff Layton
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>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] fat: fix mtime handing in __fat_write_inode
2023-10-18 11:15 [PATCH] fat: fix mtime handing in __fat_write_inode Jeff Layton
@ 2023-10-18 11:27 ` Christian Brauner
2023-10-18 11:44 ` Klara Modin
1 sibling, 0 replies; 6+ messages in thread
From: Christian Brauner @ 2023-10-18 11:27 UTC (permalink / raw)
To: Jeff Layton
Cc: Christian Brauner, linux-kernel, linux-fsdevel, OGAWA Hirofumi,
Klara Modin, Al Viro
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fat: fix mtime handing in __fat_write_inode
2023-10-18 11:15 [PATCH] fat: fix mtime handing in __fat_write_inode Jeff Layton
2023-10-18 11:27 ` Christian Brauner
@ 2023-10-18 11:44 ` Klara Modin
2023-10-18 11:55 ` Jeff Layton
1 sibling, 1 reply; 6+ messages in thread
From: Klara Modin @ 2023-10-18 11:44 UTC (permalink / raw)
To: Jeff Layton
Cc: OGAWA Hirofumi, Christian Brauner, Al Viro, linux-kernel,
linux-fsdevel
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>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fat: fix mtime handing in __fat_write_inode
2023-10-18 11:44 ` Klara Modin
@ 2023-10-18 11:55 ` Jeff Layton
2023-10-18 12:03 ` Klara Modin
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Layton @ 2023-10-18 11:55 UTC (permalink / raw)
To: Klara Modin
Cc: OGAWA Hirofumi, Christian Brauner, Al Viro, linux-kernel,
linux-fsdevel
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>
> >
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fat: fix mtime handing in __fat_write_inode
2023-10-18 11:55 ` Jeff Layton
@ 2023-10-18 12:03 ` Klara Modin
2023-10-18 12:09 ` Christian Brauner
0 siblings, 1 reply; 6+ messages in thread
From: Klara Modin @ 2023-10-18 12:03 UTC (permalink / raw)
To: Jeff Layton
Cc: OGAWA Hirofumi, Christian Brauner, Al Viro, linux-kernel,
linux-fsdevel
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>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fat: fix mtime handing in __fat_write_inode
2023-10-18 12:03 ` Klara Modin
@ 2023-10-18 12:09 ` Christian Brauner
0 siblings, 0 replies; 6+ messages in thread
From: Christian Brauner @ 2023-10-18 12:09 UTC (permalink / raw)
To: Klara Modin
Cc: Jeff Layton, OGAWA Hirofumi, Al Viro, linux-kernel, linux-fsdevel
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!
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-10-18 12:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18 11:15 [PATCH] fat: fix mtime handing in __fat_write_inode Jeff Layton
2023-10-18 11:27 ` Christian Brauner
2023-10-18 11:44 ` Klara Modin
2023-10-18 11:55 ` Jeff Layton
2023-10-18 12:03 ` Klara Modin
2023-10-18 12:09 ` Christian Brauner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.