2023-08-09 09:51:41

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [PATCH v7 05/13] fat: make fat_update_time get its own timestamp

Jeff Layton <[email protected]> writes:

> Also, it may be that things have changed by the time we get to calling
> fat_update_time after checking inode_needs_update_time. Ensure that we
> attempt the i_version bump if any of the S_* flags besides S_ATIME are
> set.

I'm not sure what it meaning though, this is from
generic_update_time(). Are you going to change generic_update_time()
too? If so, it doesn't break lazytime feature?

Thanks.

> Signed-off-by: Jeff Layton <[email protected]>
> ---
> fs/fat/misc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/fat/misc.c b/fs/fat/misc.c
> index 67006ea08db6..8cab87145d63 100644
> --- a/fs/fat/misc.c
> +++ b/fs/fat/misc.c
> @@ -347,14 +347,14 @@ int fat_update_time(struct inode *inode, struct timespec64 *now, int flags)
> return 0;
>
> if (flags & (S_ATIME | S_CTIME | S_MTIME)) {
> - fat_truncate_time(inode, now, flags);
> + fat_truncate_time(inode, NULL, flags);
> if (inode->i_sb->s_flags & SB_LAZYTIME)
> dirty_flags |= I_DIRTY_TIME;
> else
> dirty_flags |= I_DIRTY_SYNC;
> }
>
> - if ((flags & S_VERSION) && inode_maybe_inc_iversion(inode, false))
> + if ((flags & (S_VERSION|S_CTIME|S_MTIME)) && inode_maybe_inc_iversion(inode, false))
> dirty_flags |= I_DIRTY_SYNC;
>
> __mark_inode_dirty(inode, dirty_flags);

--
OGAWA Hirofumi <[email protected]>


2023-08-09 09:56:07

by OGAWA Hirofumi

[permalink] [raw]
Subject: Re: [PATCH v7 05/13] fat: make fat_update_time get its own timestamp

OGAWA Hirofumi <[email protected]> writes:

> Jeff Layton <[email protected]> writes:
>
>> Also, it may be that things have changed by the time we get to calling
>> fat_update_time after checking inode_needs_update_time. Ensure that we
>> attempt the i_version bump if any of the S_* flags besides S_ATIME are
>> set.
>
> I'm not sure what it meaning though, this is from
> generic_update_time(). Are you going to change generic_update_time()
> too? If so, it doesn't break lazytime feature?
>
> Thanks.

BTW, fat is not implementing lazytime now, but it is for future.
--
OGAWA Hirofumi <[email protected]>

2023-08-09 10:41:49

by Jeffrey Layton

[permalink] [raw]
Subject: Re: [PATCH v7 05/13] fat: make fat_update_time get its own timestamp

On Wed, 2023-08-09 at 17:37 +0900, OGAWA Hirofumi wrote:
> Jeff Layton <[email protected]> writes:
>
> > Also, it may be that things have changed by the time we get to calling
> > fat_update_time after checking inode_needs_update_time. Ensure that we
> > attempt the i_version bump if any of the S_* flags besides S_ATIME are
> > set.
>
> I'm not sure what it meaning though, this is from
> generic_update_time(). Are you going to change generic_update_time()
> too? If so, it doesn't break lazytime feature?
>

Yes. generic_update_time is also being changed in a similar fashion.
This shouldn't break the lazytime feature: lazytime is all about how and
when timestamps get written to disk. This work is all about which
clocksource the timestamps originally come from.

> Thanks.
>
> > Signed-off-by: Jeff Layton <[email protected]>
> > ---
> > fs/fat/misc.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/fat/misc.c b/fs/fat/misc.c
> > index 67006ea08db6..8cab87145d63 100644
> > --- a/fs/fat/misc.c
> > +++ b/fs/fat/misc.c
> > @@ -347,14 +347,14 @@ int fat_update_time(struct inode *inode, struct timespec64 *now, int flags)
> > return 0;
> >
> > if (flags & (S_ATIME | S_CTIME | S_MTIME)) {
> > - fat_truncate_time(inode, now, flags);
> > + fat_truncate_time(inode, NULL, flags);
> > if (inode->i_sb->s_flags & SB_LAZYTIME)
> > dirty_flags |= I_DIRTY_TIME;
> > else
> > dirty_flags |= I_DIRTY_SYNC;
> > }
> >
> > - if ((flags & S_VERSION) && inode_maybe_inc_iversion(inode, false))
> > + if ((flags & (S_VERSION|S_CTIME|S_MTIME)) && inode_maybe_inc_iversion(inode, false))
> > dirty_flags |= I_DIRTY_SYNC;
> >
> > __mark_inode_dirty(inode, dirty_flags);
>

--
Jeff Layton <[email protected]>