Re: [Cluster-devel] [PATCH v7 12/13] ext4: switch to multigrain timestamps

Xi Ruoyao <[email protected]> Tue, 19 Sep 2023 15:05:24 +0800
Newsgroups com.redhat.cluster-devel,dev.linux.lists.ntfs3,dev.linux.lists.ocfs2-devel,dev.linux.lists.v9fs,net.sourceforge.lists.linux-f2fs-devel,org.infradead.lists.linux-mtd,org.kernel.vger.ceph-devel,org.kernel.vger.ecryptfs,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-cifs,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs,org.kernel.vger.linux-unionfs,org.kernel.vger.linux-xfs,org.kvack.linux-mm,org.ozlabs.lists.linux-erofs
Message-ID <bf0524debb976627693e12ad23690094e4514303.camel@linuxfromscratch.org>
On Mon, 2023-08-07 at 15:38 -0400, Jeff Layton wrote:
> Enable multigrain timestamps, which should ensure that there is an
> apparent change to the timestamp whenever it has been written after
> being actively observed via getattr.
>=20
> For ext4, we only need to enable the FS_MGTIME flag.

Hi Jeff,

This patch causes a gnulib test failure:

$ ~/sources/lfs/grep-3.11/gnulib-tests/test-stat-time
test-stat-time.c:141: assertion 'statinfo[0].st_mtime < statinfo[2].st_mtim=
e || (statinfo[0].st_mtime =3D=3D statinfo[2].st_mtime && (get_stat_mtime_n=
s (&statinfo[0]) < get_stat_mtime_ns (&statinfo[2])))' failed
Aborted (core dumped)

The source code of the test:
https://git.savannah.gnu.org/cgit/gnulib.git/tree/tests/test-stat-time.c

Is this an expected change?

> Acked-by: Theodore Ts'o <[email protected]>
> Reviewed-by: Jan Kara <[email protected]>
> Signed-off-by: Jeff Layton <[email protected]>
> ---
> =C2=A0fs/ext4/super.c | 2 +-
> =C2=A01 file changed, 1 insertion(+), 1 deletion(-)
>=20
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index b54c70e1a74e..cb1ff47af156 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -7279,7 +7279,7 @@ static struct file_system_type ext4_fs_type =3D {
> =C2=A0=09.init_fs_context=09=3D ext4_init_fs_context,
> =C2=A0=09.parameters=09=09=3D ext4_param_specs,
> =C2=A0=09.kill_sb=09=09=3D kill_block_super,
> -=09.fs_flags=09=09=3D FS_REQUIRES_DEV | FS_ALLOW_IDMAP,
> +=09.fs_flags=09=09=3D FS_REQUIRES_DEV | FS_ALLOW_IDMAP |
> FS_MGTIME,
> =C2=A0};
> =C2=A0MODULE_ALIAS_FS("ext4");
> =C2=A0
>=20