From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jakub.kicinski@netronome.com,
shuah@kernel.org, ast@kernel.org, daniel@iogearbox.net,
rong.a.chen@intel.com, mlxsw@mellanox.com
Subject: [patch net-next] selftests: bpf: don't try to read files without read permission
Date: Tue, 15 Oct 2019 12:00:56 +0200 [thread overview]
Message-ID: <20191015100057.19199-1-jiri@resnulli.us> (raw)
From: Jiri Pirko <jiri@mellanox.com>
Recently couple of files that are write only were added to netdevsim
debugfs. Don't read these files and avoid error.
Reported-by: kernel test robot <rong.a.chen@intel.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
tools/testing/selftests/bpf/test_offload.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_offload.py b/tools/testing/selftests/bpf/test_offload.py
index 15a666329a34..c44c650bde3a 100755
--- a/tools/testing/selftests/bpf/test_offload.py
+++ b/tools/testing/selftests/bpf/test_offload.py
@@ -312,7 +312,7 @@ class DebugfsDir:
if f == "ports":
continue
p = os.path.join(path, f)
- if os.path.isfile(p):
+ if os.path.isfile(p) and os.access(p, os.R_OK):
_, out = cmd('cat %s/%s' % (path, f))
dfs[f] = out.strip()
elif os.path.isdir(p):
--
2.21.0
next reply other threads:[~2019-10-15 10:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 10:00 Jiri Pirko [this message]
2019-10-15 15:35 ` [patch net-next] selftests: bpf: don't try to read files without read permission Jakub Kicinski
2019-10-15 23:28 ` Alexei Starovoitov
2019-10-31 23:35 ` Jakub Kicinski
2019-10-31 23:40 ` Jakub Kicinski
2019-11-01 6:36 ` Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191015100057.19199-1-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=rong.a.chen@intel.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox