Re: [LTP] [PATCH 1/4] libswap: add known swap supported fs check

Petr Vorel
2024-01-22T09:14:18Z

Hi Li,

> This introduce an enhancement to the library's is_swap_supported
> function to check for filesystem compatibility before attempting
> to create and enable a swap file. A list of supported filesystems
> is added (ext2, ext3, ext4, xfs, vfat, exfat, ntfs), and a check
> against this list is performed to ensure that the swap operations
> are only attempted on known compatible filesystems.

> If the make_swapfile function fails, the error handling is now
> more descriptive: it distinguishes between failures due to the
> filesystem not supporting swap files and other types of failures.
> Similarly, when attempting to enable the swap file with swapon,
> the patch ensures that clearer error messages are provided in
> cases where the operation is not supported by the filesystem.

+1

Reviewed-by: Petr Vorel <pvorel@suse.cz>

formatting issues (tabs) are actually mostly from this commit, please fix them
before merge.

libswap.c:40: WARNING: Missing a blank line after declarations
libswap.c:66: WARNING: please, no spaces at the start of a line
libswap.c:67: WARNING: Missing a blank line after declarations
libswap.c:67: WARNING: please, no spaces at the start of a line
libswap.c:67: WARNING: suspect code indent for conditional statements (7, 15)
libswap.c:68: ERROR: code indent should use tabs where possible
libswap.c:68: WARNING: please, no spaces at the start of a line
libswap.c:68: WARNING: suspect code indent for conditional statements (15, 23)
libswap.c:69: ERROR: code indent should use tabs where possible
libswap.c:69: WARNING: please, no spaces at the start of a line
libswap.c:70: ERROR: code indent should use tabs where possible
libswap.c:70: WARNING: please, no spaces at the start of a line
libswap.c:70: WARNING: suspect code indent for conditional statements (15, 23)
libswap.c:71: ERROR: code indent should use tabs where possible
libswap.c:71: WARNING: please, no spaces at the start of a line
libswap.c:72: WARNING: please, no spaces at the start of a line

Kind regards,
Petr