diff mbox series

[rdma-core,v2] srp_daemon: improve the debug message for is_enabled_by_rules_file

Message ID 20190712143147.10414-1-honli@redhat.com (mailing list archive)
State Superseded
Headers show
Series [rdma-core,v2] srp_daemon: improve the debug message for is_enabled_by_rules_file | expand

Commit Message

Honggang LI July 12, 2019, 2:31 p.m. UTC
Signed-off-by: Honggang Li <honli@redhat.com>
---
 srp_daemon/srp_daemon.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jason Gunthorpe July 12, 2019, 3:41 p.m. UTC | #1
On Fri, Jul 12, 2019 at 10:31:47AM -0400, Honggang Li wrote:
> Signed-off-by: Honggang Li <honli@redhat.com>

This really needs some commit message explaining why this should be
done

Jason
diff mbox series

Patch

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);