[LTP] [PATCH 1/1] libswap: Change TWARN message to TINFO

Petr Vorel pvorel@suse.cz
Wed Apr 17 14:24:18 CEST 2024


> Hi!
> Looking at the patches we get the warning from the is_swap_supported()
> because we create only 10 blocks worth of swapfile there, right?

> So the easiest fix is to make sure we create big enough swapfile there
> as well, what about?

> diff --git a/libs/libltpswap/libswap.c b/libs/libltpswap/libswap.c
> index 313a15f24..36b5af483 100644
> --- a/libs/libltpswap/libswap.c
> +++ b/libs/libltpswap/libswap.c
> @@ -192,7 +192,7 @@ int make_swapfile_(const char *file, const int lineno,
>  bool is_swap_supported(const char *filename)
>  {
>         int i, sw_support = 0;
> -       int ret = SAFE_MAKE_SWAPFILE_BLKS(filename, 10);
> +       int ret = SAFE_MAKE_SWAPFILE_SIZE(filename, 1);
Let me first check where it's needed, because SAFE_MAKE_SWAPFILE_BLKS() is
called on more places.

Also, first is needed to move __FILE__, __LINE__ in macros (from function),
sending patch...

Kind regards,
Petr

>         int fi_contiguous = file_is_contiguous(filename);
>         long fs_type = tst_fs_type(filename);
>         const char *fstype = tst_fs_type_name(fs_type);


More information about the ltp mailing list