Skip to contentSkip to conversation

dm-multipath: Print more explicit warnings when dealing with multipath messages

RFC PATCH In review Jose Castillo 2 participants 2 messages Jan 29, 2014 – Mar 12, 2014 Device mapper

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 dm-multipath: Print more explicit warnings when dealing with multipath messages

The following warning message "Unrecognised multipath message received" is displayed in two different situations inside the function multipath_message: when the number of arguments passed is invalid and when the string passed in argv[0] is not recognized. With this patch, both warnings are more specific to each case and is easier to identify where the problem is.

---
 drivers/md/dm-mpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-mpath.c +2 -2
index 6eb9dc9..95c4044 100644
@@ -1552,7 +1552,7 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
 	}
 
 	if (argc != 2) {
-		DMWARN("Unrecognised multipath message received.");
+		DMWARN("Invalid multipath message arguments. Expected 2 arguments, got %d.", argc);
 		goto out;
 	}
 
@@ -1570,7 +1570,7 @@ static int multipath_message(struct dm_target *ti, unsigned argc, char **argv)
 	else if (!strcasecmp(argv[0], "fail_path"))
 		action = fail_path;
 	else {
-		DMWARN("Unrecognised multipath message received.");
+		DMWARN("Unrecognised multipath message received: %s", argv[0]);
 		goto out;
 	}
 
Signature · 1 line
1.8.4.2
#1 lore raw
Quoted 7 lines · Jose Castillo

The following warning message "Unrecognised multipath message received" is displayed in two different situations inside the function multipath_message: when the number of arguments passed is invalid and when the string passed in argv[0] is not recognized. With this patch, both warnings are more specific to each case and is easier to identify where the problem is.

Hi Jose,

I've picked this patch up for 3.15. It is staged in the 'for-next' branch of linux-dm.git, see:
https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=4a5f0cfea2ba2d765f29f3951e3b993fc76206b2

Thanks,
Mike