diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-28 12:27:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-28 12:27:58 -0400 |
commit | e0f3e6a7ccc002be056b6a21768fceee0d44941e (patch) | |
tree | 2a37947a080ea84ef14d8d0a68c5e995e0505bf7 /drivers/md/dm-raid.c | |
parent | 43937003de5b677781b2fe4c871d628ab00cc341 (diff) | |
parent | dafa724bf582181d9a7d54f5cb4ca0bf8ef29269 (diff) |
Merge tag 'dm-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mike Snitzer:
- a couple DM raid and DM mirror fixes
- a couple .request_fn request-based DM NULL pointer fixes
- a fix for a DM target reference count leak, on target load error,
that prevented associated DM target kernel module(s) from being
removed
* tag 'dm-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm table: fix missing dm_put_target_type() in dm_table_add_target()
dm rq: clear kworker_task if kthread_run() returned an error
dm: free io_barrier after blk_cleanup_queue call
dm raid: fix activation of existing raid4/10 devices
dm mirror: use all available legs on multiple failures
dm mirror: fix read error on recovery after default leg failure
dm raid: fix compat_features validation
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r-- | drivers/md/dm-raid.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 8abde6b8cedc..6d53810963f7 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
@@ -266,7 +266,7 @@ static struct raid_type { | |||
266 | {"raid10_offset", "raid10 offset (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_OFFSET}, | 266 | {"raid10_offset", "raid10 offset (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_OFFSET}, |
267 | {"raid10_near", "raid10 near (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_NEAR}, | 267 | {"raid10_near", "raid10 near (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_NEAR}, |
268 | {"raid10", "raid10 (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_DEFAULT}, | 268 | {"raid10", "raid10 (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_DEFAULT}, |
269 | {"raid4", "raid4 (dedicated last parity disk)", 1, 2, 4, ALGORITHM_PARITY_N}, /* raid4 layout = raid5_n */ | 269 | {"raid4", "raid4 (dedicated first parity disk)", 1, 2, 5, ALGORITHM_PARITY_0}, /* raid4 layout = raid5_0 */ |
270 | {"raid5_n", "raid5 (dedicated last parity disk)", 1, 2, 5, ALGORITHM_PARITY_N}, | 270 | {"raid5_n", "raid5 (dedicated last parity disk)", 1, 2, 5, ALGORITHM_PARITY_N}, |
271 | {"raid5_ls", "raid5 (left symmetric)", 1, 2, 5, ALGORITHM_LEFT_SYMMETRIC}, | 271 | {"raid5_ls", "raid5 (left symmetric)", 1, 2, 5, ALGORITHM_LEFT_SYMMETRIC}, |
272 | {"raid5_rs", "raid5 (right symmetric)", 1, 2, 5, ALGORITHM_RIGHT_SYMMETRIC}, | 272 | {"raid5_rs", "raid5 (right symmetric)", 1, 2, 5, ALGORITHM_RIGHT_SYMMETRIC}, |
@@ -2087,11 +2087,11 @@ static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev) | |||
2087 | /* | 2087 | /* |
2088 | * No takeover/reshaping, because we don't have the extended v1.9.0 metadata | 2088 | * No takeover/reshaping, because we don't have the extended v1.9.0 metadata |
2089 | */ | 2089 | */ |
2090 | if (le32_to_cpu(sb->level) != mddev->level) { | 2090 | if (le32_to_cpu(sb->level) != mddev->new_level) { |
2091 | DMERR("Reshaping/takeover raid sets not yet supported. (raid level/stripes/size change)"); | 2091 | DMERR("Reshaping/takeover raid sets not yet supported. (raid level/stripes/size change)"); |
2092 | return -EINVAL; | 2092 | return -EINVAL; |
2093 | } | 2093 | } |
2094 | if (le32_to_cpu(sb->layout) != mddev->layout) { | 2094 | if (le32_to_cpu(sb->layout) != mddev->new_layout) { |
2095 | DMERR("Reshaping raid sets not yet supported. (raid layout change)"); | 2095 | DMERR("Reshaping raid sets not yet supported. (raid layout change)"); |
2096 | DMERR(" 0x%X vs 0x%X", le32_to_cpu(sb->layout), mddev->layout); | 2096 | DMERR(" 0x%X vs 0x%X", le32_to_cpu(sb->layout), mddev->layout); |
2097 | DMERR(" Old layout: %s w/ %d copies", | 2097 | DMERR(" Old layout: %s w/ %d copies", |
@@ -2102,7 +2102,7 @@ static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev) | |||
2102 | raid10_md_layout_to_copies(mddev->layout)); | 2102 | raid10_md_layout_to_copies(mddev->layout)); |
2103 | return -EINVAL; | 2103 | return -EINVAL; |
2104 | } | 2104 | } |
2105 | if (le32_to_cpu(sb->stripe_sectors) != mddev->chunk_sectors) { | 2105 | if (le32_to_cpu(sb->stripe_sectors) != mddev->new_chunk_sectors) { |
2106 | DMERR("Reshaping raid sets not yet supported. (stripe sectors change)"); | 2106 | DMERR("Reshaping raid sets not yet supported. (stripe sectors change)"); |
2107 | return -EINVAL; | 2107 | return -EINVAL; |
2108 | } | 2108 | } |
@@ -2115,6 +2115,8 @@ static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev) | |||
2115 | return -EINVAL; | 2115 | return -EINVAL; |
2116 | } | 2116 | } |
2117 | 2117 | ||
2118 | DMINFO("Discovered old metadata format; upgrading to extended metadata format"); | ||
2119 | |||
2118 | /* Table line is checked vs. authoritative superblock */ | 2120 | /* Table line is checked vs. authoritative superblock */ |
2119 | rs_set_new(rs); | 2121 | rs_set_new(rs); |
2120 | } | 2122 | } |
@@ -2258,7 +2260,8 @@ static int super_validate(struct raid_set *rs, struct md_rdev *rdev) | |||
2258 | if (!mddev->events && super_init_validation(rs, rdev)) | 2260 | if (!mddev->events && super_init_validation(rs, rdev)) |
2259 | return -EINVAL; | 2261 | return -EINVAL; |
2260 | 2262 | ||
2261 | if (le32_to_cpu(sb->compat_features) != FEATURE_FLAG_SUPPORTS_V190) { | 2263 | if (le32_to_cpu(sb->compat_features) && |
2264 | le32_to_cpu(sb->compat_features) != FEATURE_FLAG_SUPPORTS_V190) { | ||
2262 | rs->ti->error = "Unable to assemble array: Unknown flag(s) in compatible feature flags"; | 2265 | rs->ti->error = "Unable to assemble array: Unknown flag(s) in compatible feature flags"; |
2263 | return -EINVAL; | 2266 | return -EINVAL; |
2264 | } | 2267 | } |
@@ -3646,7 +3649,7 @@ static void raid_resume(struct dm_target *ti) | |||
3646 | 3649 | ||
3647 | static struct target_type raid_target = { | 3650 | static struct target_type raid_target = { |
3648 | .name = "raid", | 3651 | .name = "raid", |
3649 | .version = {1, 9, 0}, | 3652 | .version = {1, 9, 1}, |
3650 | .module = THIS_MODULE, | 3653 | .module = THIS_MODULE, |
3651 | .ctr = raid_ctr, | 3654 | .ctr = raid_ctr, |
3652 | .dtr = raid_dtr, | 3655 | .dtr = raid_dtr, |