[LTP] [PATCH] syscalls/madvise11: Ignore unpoison failure under kernel lockdown
Petr Vorel
pvorel@suse.cz
Tue Jun 20 11:01:30 CEST 2023
> On 20. 06. 23 10:24, Petr Vorel wrote:
> > 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);
> Good point. Though TST_RET is long int so it should be %ld. Should I send a
> v2?
Yes, please.
Kind regards,
Petr
More information about the ltp
mailing list