]> git.proxmox.com Git - mirror_iproute2.git/commit
lib/bpf: Fix and simplify bpf_mnt_check_target()
authorAndrea Claudi <aclaudi@redhat.com>
Mon, 22 Feb 2021 17:43:10 +0000 (18:43 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 23 Feb 2021 02:19:01 +0000 (18:19 -0800)
commitd4fcdbbec9df2fe287e443b5a69f622768c63126
treed63dbf80d0cd57112de4053e0e8eb1fa50f73c1e
parent1e25de9a9239cd6d7cc1d0ec3f7552d4ee7087e8
lib/bpf: Fix and simplify bpf_mnt_check_target()

As stated in commit ac3415f5c1b1 ("lib/fs: Fix and simplify make_path()"),
calling stat() before mkdir() is racey, because the entry might change in
between.

As the call to stat() seems to only check for target existence, we can
simply call mkdir() unconditionally and catch all errors but EEXIST.

Fixes: 95ae9a4870e7 ("bpf: fix mnt path when from env")
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
lib/bpf_legacy.c