From: Honggang Li <honli@redhat.com>
To: bvanassche@acm.org, jgg@ziepe.ca
Cc: linux-rdma@vger.kernel.org, Honggang Li <honli@redhat.com>
Subject: [rdma-core patch v3] srp_daemon: improve the debug message for is_enabled_by_rules_file
Date: Mon, 15 Jul 2019 00:16:14 -0400 [thread overview]
Message-ID: <20190715041614.27979-1-honli@redhat.com> (raw)
If the target was disallowed by rule file, user can not distinguish that
from the old debug message.
pr_debug("Found an SRP target with id_ext %s - check if it allowed by rules file\n", target->id_ext);
It implicitly implied by the message next to the old debug message.
pr_debug("Found an SRP target with id_ext %s - check if it is already connected\n", target->id_ext);
The improved debug message will feedback the check result of rule file, user
no longer needs to wonder the target is allowed or not.
Signed-off-by: Honggang Li <honli@redhat.com>
---
srp_daemon/srp_daemon.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index a004f6a4..e85b9668 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -349,10 +349,11 @@ static int is_enabled_by_rules_file(struct target_details *target)
int rule;
struct config_t *conf = config;
- if (NULL == conf->rules)
+ if (NULL == conf->rules) {
+ pr_debug("Allowing SRP target with id_ext %s because not using a rules file\n", target->id_ext);
return 1;
+ }
- pr_debug("Found an SRP target with id_ext %s - check if it allowed by rules file\n", target->id_ext);
rule = -1;
do {
rule++;
@@ -392,6 +393,9 @@ static int is_enabled_by_rules_file(struct target_details *target)
target->options = conf->rules[rule].options;
+ pr_debug("SRP target with id_ext %s %s by rules file\n",
+ target->id_ext,
+ conf->rules[rule].allow ? "allowed" : "disallowed");
return conf->rules[rule].allow;
} while (1);
--
2.20.1
next reply other threads:[~2019-07-15 4:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 4:16 Honggang Li [this message]
2019-07-23 19:34 ` [rdma-core patch v3] srp_daemon: improve the debug message for is_enabled_by_rules_file Bart Van Assche
2019-07-25 16:53 ` Jason Gunthorpe
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=20190715041614.27979-1-honli@redhat.com \
--to=honli@redhat.com \
--cc=bvanassche@acm.org \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.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