All of lore.kernel.org
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] tse_swap: Add fallback definitions for swapon
Date: Fri, 28 Aug 2026 11:30:24 +0000	[thread overview]
Message-ID: <20260828113024.9090-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260828-swapon_discard_coverage-v3-1-136924a1a730@suse.com>

Hi Andrea,

On August 28, 2026, Andrea Cervesato wrote:
> tse_swap: Add fallback definitions for swapon

--- [PATCH 2/3] ---

> +	if (tst_syscall(__NR_swapoff, loop_dev) != 0)
> +		tst_brk(TBROK | TTERRNO, "swapoff(%s) failed", loop_dev);
> [...]
> +	if (swap_active && tst_syscall(__NR_swapoff, loop_dev) != 0)
> +		tst_res(TWARN | TTERRNO, "swapoff(%s) failed", loop_dev);

Could these reports use TERRNO instead? These calls bypass TEST(), so
TTERRNO reads the TST_ERR left by the earlier successful swapon() call.
That value is normally zero, causing a real swapoff() failure to be
reported as "Success".

> +/*\
> + * Check that :manpage:`swapon(2)` discard flags control swapon-time area discard:
> [...]
> +	.needs_root = 1,

Could the description state why root is required? Root-only tests are
expected to document the reason; here swapon(), swapoff(), and loop-device
setup require it.

--- [PATCH 3/3] ---

> +	if (TST_RET == 0 && tst_syscall(__NR_swapoff, tc->path) != 0)
> +		tst_res(TWARN | TTERRNO, "swapoff(%s) failed", tc->path);

Could this use TERRNO as well? On this recovery path the preceding
TST_EXP_FAIL() captured a successful swapon(), leaving TST_ERR equal to
zero, so TTERRNO cannot report the swapoff() failure's errno.

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-08-28 11:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 11:10 [LTP] [PATCH v3 0/3] Increase coverage for swapon syscall Andrea Cervesato
2026-08-28 11:10 ` [LTP] [PATCH v3 1/3] tse_swap: Add fallback definitions for swapon Andrea Cervesato
2026-08-28 11:30   ` linuxtestproject.agent [this message]
2026-08-28 11:10 ` [LTP] [PATCH v3 2/3] swapon04: Add test for discard flags Andrea Cervesato
2026-09-03 11:18   ` Cyril Hrubis
2026-08-28 11:10 ` [LTP] [PATCH v3 3/3] swapon02: Add test cases for invalid swapflags Andrea Cervesato
2026-09-03 11:32   ` Cyril Hrubis
  -- strict thread matches above, loose matches on Subject: below --
2026-09-03 13:04 [LTP] [PATCH v4 1/3] tse_swap: Add fallback definitions for swapon Andrea Cervesato
2026-09-03 16:01 ` [LTP] " linuxtestproject.agent
2026-09-04  7:16   ` Andrea Cervesato via ltp

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=20260828113024.9090-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.