Skip to content

Commit

Permalink
bpf: re-fix skip write only files in debugfs
Browse files Browse the repository at this point in the history
Commit 5bc60de ("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 8101e06 ("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 ae8a76f
iby not reintroducing 5bc60de again.

Fixes: ae8a76f ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed Nov 4, 2019
1 parent 54e0602 commit 56c1291
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/testing/selftests/bpf/test_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ def _debugfs_dir_read(self, path):
continue

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))
dfs[f] = out.strip()
elif os.path.isdir(p):
Expand Down

0 comments on commit 56c1291

Please sign in to comment.