[LTP] [PATCH v4 2/4] BPF: Sanity check creating and updating maps
Cyril Hrubis
chrubis@suse.cz
Mon Sep 2 16:05:32 CEST 2019
Hi!
> Small nit (maybe personal preference), I'd rather make this check for
> map_types.attr, as opposed to test number / some position in array.
Sounds good.
> > + case 0:
> > + if (TST_RET != -1 || TST_ERR != ENOENT) {
> > + tst_res(TFAIL | TTERRNO,
> > + "Empty hash map lookup should fail with ENOENT");
> > + } else {
> > + tst_res(TPASS | TTERRNO, "Empty hash map lookup");
> > + }
> > + break;
> > + case 1:
> > + if (TST_RET != -1) {
> > + for (i = 0;;) {
> > + if (val_get[i] != 0) {
> > + tst_res(TFAIL,
> > + "Preallocated array map val not zero");
>
> If we hit this TFAIL, will the loop terminate?
My bad, I will change this to use proper for() loop.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list