[lustre-devel] [PATCH 155/622] lnet: properly error check sensitivity

James Simmons jsimmons at infradead.org
Thu Feb 27 13:10:23 PST 2020


From: Amir Shehata <ashehata at whamcloud.com>

Reject setting health sensitivity greater than the maximum health
value.

WC-bug-id: https://jira.whamcloud.com/browse/LU-11530
Lustre-commit: a5c1cd5ec240 ("LU-11530 lnet: properly error check sensitivity")
Signed-off-by: Amir Shehata <ashehata at whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33392
Reviewed-by: Sonia Sharma <sharmaso at whamcloud.com>
Reviewed-by: Doug Oucharek <dougso at me.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/lnet/api-ni.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index 21e0175..a2c648e 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -175,9 +175,11 @@ static int lnet_discover(struct lnet_process_id id, u32 force,
 		return 0;
 	}
 
-	if (value == *sensitivity) {
+	if (value > LNET_MAX_HEALTH_VALUE) {
 		mutex_unlock(&the_lnet.ln_api_mutex);
-		return 0;
+		CERROR("Invalid health value. Maximum: %d value = %lu\n",
+		       LNET_MAX_HEALTH_VALUE, value);
+		return -EINVAL;
 	}
 
 	*sensitivity = value;
-- 
1.8.3.1



More information about the lustre-devel mailing list