Skip to content

Commit

Permalink
dm mpath: print more useful warnings in multipath_message()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jose Castillo authored and Mike Snitzer committed Mar 27, 2014
1 parent 3a01750 commit a356e42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,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;
}

Expand All @@ -1496,7 +1496,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;
}

Expand Down

0 comments on commit a356e42

Please sign in to comment.