All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/madvise11: Ignore unpoison failure under kernel lockdown
Date: Tue, 20 Jun 2023 10:24:42 +0200	[thread overview]
Message-ID: <20230620082442.GA270877@pevik> (raw)
In-Reply-To: <20230607144517.24972-1-mdoucha@suse.cz>

Hi Martin,

...
> -	return SAFE_OPEN(debugfs_fp, O_WRONLY);
> +	TEST(open(debugfs_fp, O_WRONLY));
> +
> +	if (TST_RET == -1 && TST_ERR == EPERM && tst_lockdown_enabled()) {
> +		tst_res(TINFO,
> +			"Cannot restore soft-offlined memory due to lockdown");
> +		return TST_RET;
> +	}
> +
> +	if (TST_RET == -1)
> +		tst_brk(TBROK | TTERRNO, "open(%s) failed", debugfs_fp);
> +	else if (TST_RET < 0)
> +		tst_brk(TBROK | TTERRNO, "Invalid open() return value");
nit: I'd print the return value as we do in safe_open():
		tst_brk(TBROK | TTERRNO, "Invalid open() return value %d", TST_RET);

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

Thanks for fixing this!

Kind regards,
Petr

> +
> +	return TST_RET;
>  }


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

  reply	other threads:[~2023-06-20  8:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 14:45 [LTP] [PATCH] syscalls/madvise11: Ignore unpoison failure under kernel lockdown Martin Doucha
2023-06-20  8:24 ` Petr Vorel [this message]
2023-06-20  8:28   ` Martin Doucha
2023-06-20  9:01     ` 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=20230620082442.GA270877@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@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 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.