Re: [PATCH bpf-next v4 06/24] bpf: Refactor kptr_off_tab into btf_record

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 04, 2022 at 09:39:22AM IST, Alexei Starovoitov wrote:
> On Thu, Nov 3, 2022 at 9:01 PM Alexei Starovoitov
> <alexei.starovoitov@xxxxxxxxx> wrote:
> >
> > On Fri, Nov 04, 2022 at 12:39:55AM +0530, Kumar Kartikeya Dwivedi wrote:
> > >
> > > -enum bpf_kptr_type {
> > > -     BPF_KPTR_UNREF,
> > > -     BPF_KPTR_REF,
> > > +enum btf_field_type {
> > > +     BPF_KPTR_UNREF = (1 << 2),
> > > +     BPF_KPTR_REF   = (1 << 3),
> > > +     BPF_KPTR       = BPF_KPTR_UNREF | BPF_KPTR_REF,
> > >  };
> >
> > ...
> >
> > > +             for (i = 0; i < sizeof(map->record->field_mask) * 8; i++) {
> > > +                     switch (map->record->field_mask & (1 << i)) {
> > > +                     case 0:
> > > +                             continue;
> > > +                     case BPF_KPTR_UNREF:
> > > +                     case BPF_KPTR_REF:
> > > +                             if (map->map_type != BPF_MAP_TYPE_HASH &&
> > > +                                 map->map_type != BPF_MAP_TYPE_LRU_HASH &&
> > > +                                 map->map_type != BPF_MAP_TYPE_ARRAY &&
> > > +                                 map->map_type != BPF_MAP_TYPE_PERCPU_ARRAY) {
> > > +                                     ret = -EOPNOTSUPP;
> > > +                                     goto free_map_tab;
> > > +                             }
> > > +                             break;
> > > +                     default:
> > > +                             /* Fail if map_type checks are missing for a field type */
> > > +                             ret = -EOPNOTSUPP;
> > > +                             goto free_map_tab;
> > > +                     }
> >
> > With this patch alone this is also wrong.
>
> Actually this bit is probably fine. The bug is elsewhere.
>
> The point below stands:
>
>
> > And it breaks bisect.
> > Please make sure to do a full vmtest.sh for every patch in the series.

I'm sorry. I made multiple small changes to these two and never retested them
again in isolation, and then it was 'fixed' by later changes. I'll make sure it
doesn't happen again.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux