Re: [LTP] [PATCH] refluxfs: Check kernel reflink support before mount

Martin Doucha <[email protected]>
Newsgroups it.linux.lists.ltp
Message-ID <[email protected]>
On 8/13/26 12:46, Andrea Cervesato wrote:
> Hi Cyril,
> 
> Something like this?
> 
> diff --git a/lib/safe_macros.c b/lib/safe_macros.c
> index f95c5fdc5..34430d018 100644
> --- a/lib/safe_macros.c
> +++ b/lib/safe_macros.c
> @@ -993,9 +993,15 @@ int safe_mount(const char *file, const int lineno, void (*cleanup_fn)(void),
>   			"mount.%s failed with %i", filesystemtype, rval);
>   		return -1;
>   	} else if (rval == -1) {
> -		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
> -			"mount(%s, %s, %s, %lu, %p) failed", source, target,
> -			filesystemtype, mountflags, data);
> +		if (errno == EOPNOTSUPP) {
> +			tst_brkm_(file, lineno, TCONF | TERRNO, cleanup_fn,
> +				"mount(%s, %s, %s, %lu, %p) failed with EOPNOTSUPP", source, target,
> +				filesystemtype, mountflags, data);
> +		} else {
> +			tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
> +				"mount(%s, %s, %s, %lu, %p) failed", source, target,
> +				filesystemtype, mountflags, data);
> +		}
>   	} else {
>   		tst_brkm_(file, lineno, TBROK | TERRNO, cleanup_fn,
>   			"Invalid mount(%s, %s, %s, %lu, %p) return value %d",

Hi,
yes, but I think it'd be better to add a setting to struct tst_test to 
enable this TCONF check only for specific tests. By default, EOPNOTSUPP 
should still trigger TBROK.

Something like:
.mount_check_support = 1

-- 
Martin Doucha   [email protected]
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.