dm raid: check constructor arguments for invalid raid level/argument combinations
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 19 May 2016 16:49:27 +0000 (18:49 +0200)
committerMike Snitzer <snitzer@redhat.com>
Mon, 13 Jun 2016 18:40:27 +0000 (14:40 -0400)
commitf090279eaff814a550b35bb51aac6b8541bddf97
tree63013e80c7294f09668d0d91fa0a714db23a7090
parent702108d194e3649f69afcd2661282a0157c71e54
dm raid: check constructor arguments for invalid raid level/argument combinations

Reject invalid flag combinations to avoid potential data corruption or
failing raid set construction:

 - add definitions for constructor flag combinations and invalid flags
   per level

 - add bool test functions for the various raid types
   (also will be used by future reshaping enhancements)

 - introduce rs_check_for_invalid_flags() and _invalid_flags()
   to perform the validity checks

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-raid.c