bpf: Fix tests for local_storage
authorKP Singh <kpsingh@google.com>
Fri, 6 Nov 2020 10:37:44 +0000 (10:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:03 +0000 (11:53 +0100)
commitc306918ce98bc7cb66c62481b18d7e554556d4a7
treed0de17a0100cbc71b60ff096cd6d5dbc36df3f66
parent26a19bbe6003b667da63f609307473df6b52d343
bpf: Fix tests for local_storage

[ Upstream commit f0e5ba0bc481df77cf0afac2b33e420b33eeb463 ]

The {inode,sk}_storage_result checking if the correct value was retrieved
was being clobbered unconditionally by the return value of the
bpf_{inode,sk}_storage_delete call.

Also, consistently use the newly added BPF_LOCAL_STORAGE_GET_F_CREATE
flag.

Fixes: cd324d7abb3d ("bpf: Add selftests for local_storage")
Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20201106103747.2780972-7-kpsingh@chromium.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/progs/local_storage.c