[LTP] [PATCH 1/1] libswap: Change TWARN message to TINFO
Petr Vorel
pvorel@suse.cz
Wed Apr 17 15:37:49 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.
Yes, not only it's directly used from the library, which affects all swapo{ff,n}
tests, but MAKE_SWAPFILE_BLKS() is also used directly by some of the tests.
Changing it to {SAFE_,}MAKE_SWAPFILE_SIZE() on all places would mean we don't need
{SAFE_,}MAKE_SWAPFILE_BLKS() at all. Therefore I think this check should be
suppressed to TINFO. Other option is to use high enough value (more blocks)
(not sure if using really small swap file makes sense anyway).
> Also, first is needed to move __FILE__, __LINE__ in macros (from function),
> sending patch...
https://lore.kernel.org/ltp/20240417123113.731780-1-pvorel@suse.cz/
https://lore.kernel.org/ltp/20240417123113.731780-1-pvorel@suse.cz/
Kind regards,
Petr
> 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