Commit 56c1291e authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

bpf: re-fix skip write only files in debugfs

Commit 5bc60de5 ("selftests: bpf: Don't try to read files without
read permission") got reverted as the fix was not working as expected
and real fix came in via 8101e069 ("selftests: bpf: Skip write
only files in debugfs"). When bpf-next got merged into net-next, the
test_offload.py had a small conflict. Fix the resolution in ae8a76fb
iby not reintroducing 5bc60de5 again.

Fixes: ae8a76fb ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next")
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Acked-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 54e0602d
...@@ -314,7 +314,10 @@ class DebugfsDir: ...@@ -314,7 +314,10 @@ class DebugfsDir:
continue continue
p = os.path.join(path, f) p = os.path.join(path, f)
if os.path.isfile(p) and os.access(p, os.R_OK): if not os.stat(p).st_mode & stat.S_IRUSR:
continue
if os.path.isfile(p):
_, out = cmd('cat %s/%s' % (path, f)) _, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip() dfs[f] = out.strip()
elif os.path.isdir(p): elif os.path.isdir(p):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment