From: Avinesh Kumar <akumar@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: Michal Hocko <mhocko@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 2/3] swapon03: Try to swapon() as many files until it fails
Date: Thu, 06 Nov 2025 14:31:32 +0100 [thread overview]
Message-ID: <3388220.aeNJFYEL58@thinkpad> (raw)
In-Reply-To: <20251106120357.GA1013980@pevik>
> > > +
> > > + if (expected_swapfiles < 0) {
> > do we want to proceed when expected_swapfiles is 0 here?
>
> Yes, because NUM_SWAP_FILES is 15, which is safe for the changes.
> I.e. on my Tumbleweed VM it can be 23 swaps. One is used as filesystem
> partition, therefore it would work on even 22.
Understood, thanks!
> > > - /* turn on the swap file */
> > > - TST_EXP_PASS_SILENT(swapon(filename, 0));
> > > + /* Quit on a first swap file over max */
> > > + if (swapon(filename, 0) == -1)
> > so now first swapon() fail is here and then we check for errno==EPERM by
> > making another swapon() call in verify_swapon function.
> > Is it possible to combine setup_swap() and verify_swapon() and check for
> > EPERM on first swapon() fail itself?
>
> I was thinking about it as well. To support -i, we still need to have setup run
> only once. Moving code from setup to test function would require to run "setup"
> part only once (guard with static variable).
>
> Other option would be to keep setup, but test errno also here (i.e. test it twice).
> I'm not sure which one is less awkward.
ok, I forgot about more iterations scenario.
Reviewed-by: Avinesh Kumar <akumar@suse.de>
(for all patches in the series)
Regards,
Avinesh
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-11-06 13:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 15:47 [LTP] [PATCH 0/3] swapon03: Try to swapon() as many files until it fails Petr Vorel
2025-11-05 15:47 ` [LTP] [PATCH 1/3] swapon03: Cleanup Petr Vorel
2025-11-05 15:47 ` [LTP] [PATCH 2/3] swapon03: Try to swapon() as many files until it fails Petr Vorel
2025-11-06 3:46 ` Li Wang via ltp
2025-11-06 9:07 ` Petr Vorel
2025-11-06 10:11 ` Avinesh Kumar
2025-11-06 12:03 ` Petr Vorel
2025-11-06 13:31 ` Avinesh Kumar [this message]
2025-11-05 15:47 ` [LTP] [PATCH 3/3] libswap: Remove now unused tst_max_swapfiles() Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3388220.aeNJFYEL58@thinkpad \
--to=akumar@suse.de \
--cc=ltp@lists.linux.it \
--cc=mhocko@suse.com \
--cc=pvorel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox