On Thu, Nov 7, 2019 at 8:52 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote: > > From: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > > Since the automatic map-pinning happens during load, it will leave pinned > maps around if the load fails at a later stage. Fix this by unpinning any > pinned maps on cleanup. To avoid unpinning pinned maps that were reused > rather than newly pinned, add a new boolean property on struct bpf_map to > keep track of whether that map was reused or not; and only unpin those maps > that were not reused. > > Fixes: 57a00f41644f ("libbpf: Add auto-pinning of maps when loading BPF objects") > Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> Acked-by: Song Liu <songliubraving@xxxxxx>