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

Li Wang liwang@redhat.com
Mon Jan 22 15:23:35 CET 2024


On Mon, Jan 22, 2024 at 7:03 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi Petr,
>
> > On Mon, Jan 22, 2024 at 5:14 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> > > 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.
>
>
> > Thanks very much, Petr.
>
> > The patchset V2 (based on your suggestions) is published in my git
> branch.
> > In case you want to do more tests today.
>
> Thanks, I already scheduled tests, let you know later today.
>

Great, and FYI.

I just pushed a new commit to resolve the FIBMAP (unsupported on BTRFS)
problem on my ltp:libswap branch.

https://github.com/wangli5665/ltp/commit/699711bfe8c8dbc3597c46587345fa1197c054c9

Hope you can try on your side and give some feedback :).



> > https://github.com/wangli5665/ltp/tree/libswap
>
> > And, I prefer to wait for Cryil's feedback before posting them in ML:)
>
> +1
>
> Kind regards,
> Petr
>
>

-- 
Regards,
Li Wang


More information about the ltp mailing list