Skip to content

Commit

Permalink
dm raid: remove WARN_ON() in raid10_md_layout_to_format()
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Heinz Mauelshagen authored and Mike Snitzer committed Jul 25, 2017
1 parent edc11d4 commit bbac1e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,10 @@ static const char *raid10_md_layout_to_format(int layout)
if (__raid10_near_copies(layout) > 1)
return "near";

WARN_ON(__raid10_far_copies(layout) < 2);
if (__raid10_far_copies(layout) > 1)
return "far";

return "far";
return "unknown";
}

/* Return md raid10 algorithm for @name */
Expand Down

0 comments on commit bbac1e0

Please sign in to comment.