Re: [PATCH v2 4/4] selftests/mm: Fix test result reporting in gup_longterm

From: Mark Brown
Date: Tue Jun 03 2025 - 09:06:51 EST


On Tue, Jun 03, 2025 at 02:36:07PM +0200, David Hildenbrand wrote:
> On 27.05.25 18:04, Mark Brown wrote:

> > + int result = KSFT_PASS;
> > int ret;
> > + if (fd < 0) {
> > + result = KSFT_FAIL;
> > + goto report;
> > + }

> Not a fan of that, especially as it suddenly converts
> ksft_test_result_skip() -- e.g., on the memfd path -- to KSFT_FAIL.

It looks like the memfd path was an outlier here, the others all failed
if they couldn't allocate the FD.

> Can we just do the log_test_result(KSFT_FAIL/KSFT_SKIP) in the caller?

Nothing stopping that, or doing it for the cases where we want to skip.
IIRC this simplified some of the other callers a little.

Attachment: signature.asc
Description: PGP signature