[LTP] [PATCH v5 07/16] Add statmount01 test

Cyril Hrubis chrubis@suse.cz
Tue Oct 8 13:54:48 CEST 2024


Hi!
> +static void run(void)
> +{
> +	memset(st_mount, 0, sizeof(struct statmount));
> +
> +	TST_EXP_PASS(statmount(root_id, 0, st_mount, sizeof(struct statmount), 0));
> +
> +	if (TST_RET == -1)
> +		return;

I asked for this to be changed to if (!TST_PASS)

> +	TST_EXP_EQ_LI(st_mount->size, sizeof(struct statmount));
> +	TST_EXP_EQ_LI(st_mount->mask, 0);
> +	TST_EXP_EQ_LI(st_mount->sb_dev_major, 0);
> +	TST_EXP_EQ_LI(st_mount->sb_dev_minor, 0);
> +	TST_EXP_EQ_LI(st_mount->sb_magic, 0);
> +	TST_EXP_EQ_LI(st_mount->sb_flags, 0);
> +	TST_EXP_EQ_LI(st_mount->fs_type, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_id, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_parent_id, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_id_old, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_parent_id_old, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_attr, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_propagation, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_peer_group, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_master, 0);
> +	TST_EXP_EQ_LI(st_mount->propagate_from, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_root, 0);
> +	TST_EXP_EQ_LI(st_mount->mnt_point, 0);
> +}
> +
> +static void setup(void)
> +{
> +	struct ltp_statx sx;
> +
> +	SAFE_STATX(AT_FDCWD, MNTPOINT, 0, STATX_MNT_ID_UNIQUE, &sx);
> +
> +	root_id = sx.data.stx_mnt_id;

And here to be changed to mntpoint_id

> +}
> +
> +static struct tst_test test = {
> +	.test_all = run,
> +	.setup = setup,
> +	.min_kver = "6.8",
> +	.mount_device = 1,
> +	.mntpoint = MNTPOINT,
> +	.all_filesystems = 1,
> +	.skip_filesystems = (const char *const []) {
> +		"fuse",
> +		NULL
> +	},

And here I suggested that there is no point in running this for all
filesystems.

None of these has been addressed in v5.

> +	.bufs = (struct tst_buffers []) {
> +		{&st_mount, .size = sizeof(struct statmount)},
> +		{}
> +	}
> +};
> 
> -- 
> 2.43.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list