浏览代码

dm mpath: print more useful warnings in multipath_message()

The warning message "Unrecognised multipath message received" is
displayed in two different situations in multipath_message(): when the
number of arguments passed is invalid and when the string passed in
argv[0] is not recognized.

Make it easier to identify where the problem is by making these warnings
more specific with additional context for each case.

Signed-off-by: Jose Castillo <jcastillo@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Jose Castillo 12 年之前
父节点
当前提交
a356e42620
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/md/dm-mpath.c

+ 2 - 2
drivers/md/dm-mpath.c

@@ -1478,7 +1478,7 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
 	}
 	}
 
 
 	if (argc != 2) {
 	if (argc != 2) {
-		DMWARN("Unrecognised multipath message received.");
+		DMWARN("Invalid multipath message arguments. Expected 2 arguments, got %d.", argc);
 		goto out;
 		goto out;
 	}
 	}
 
 
@@ -1496,7 +1496,7 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
 	else if (!strcasecmp(argv[0], "fail_path"))
 	else if (!strcasecmp(argv[0], "fail_path"))
 		action = fail_path;
 		action = fail_path;
 	else {
 	else {
-		DMWARN("Unrecognised multipath message received.");
+		DMWARN("Unrecognised multipath message received: %s", argv[0]);
 		goto out;
 		goto out;
 	}
 	}