[LTP] [PATCH v6 2/2] fstat: add test for multiple file types using fstat

Andrea Cervesato andrea.cervesato@suse.com
Tue Mar 24 13:17:51 CET 2026


Hi Jinseok,

there's one thing to fix:

> +	int fd = open(tc->path, flags);
> +
> +	if (fd < 0) {
> +		tst_res(TCONF | TERRNO, "cannot open %s, skipping", tc->desc);
> +		return;
> +	}

This must be SAFE_OPEN(). I guess your choice was related to the fact that
open() is failing with EACCES when tc->exp_type is S_IFBLK or S_IFCHR. This
happens because tmpfs is mounted with `nodev`. To enabled devs access, you
need to specify a mount point and `.needs_devfs = 1` inside the test struct
definition. You can take `fanotify22` test as a reference to understand how
this works.

After achieving it, we can proceed with merge.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list