Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+29 -44
+1
Documentation/device-mapper/dm-raid.txt
··· 309 309 with a reshape in progress. 310 310 1.9.0 Add support for RAID level takeover/reshape/region size 311 311 and set size reduction. 312 + 1.9.1 Fix activation of existing RAID 4/10 mapped devices
+9 -6
drivers/md/dm-raid.c
··· 266 266 {"raid10_offset", "raid10 offset (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_OFFSET}, 267 267 {"raid10_near", "raid10 near (striped mirrors)", 0, 2, 10, ALGORITHM_RAID10_NEAR}, 268 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 270 {"raid5_n", "raid5 (dedicated last parity disk)", 1, 2, 5, ALGORITHM_PARITY_N}, 271 271 {"raid5_ls", "raid5 (left symmetric)", 1, 2, 5, ALGORITHM_LEFT_SYMMETRIC}, 272 272 {"raid5_rs", "raid5 (right symmetric)", 1, 2, 5, ALGORITHM_RIGHT_SYMMETRIC}, ··· 2087 2087 /* 2088 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 2091 DMERR("Reshaping/takeover raid sets not yet supported. (raid level/stripes/size change)"); 2092 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 2095 DMERR("Reshaping raid sets not yet supported. (raid layout change)"); 2096 2096 DMERR(" 0x%X vs 0x%X", le32_to_cpu(sb->layout), mddev->layout); 2097 2097 DMERR(" Old layout: %s w/ %d copies", ··· 2102 2102 raid10_md_layout_to_copies(mddev->layout)); 2103 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 2106 DMERR("Reshaping raid sets not yet supported. (stripe sectors change)"); 2107 2107 return -EINVAL; 2108 2108 } ··· 2114 2114 sb->num_devices, mddev->raid_disks); 2115 2115 return -EINVAL; 2116 2116 } 2117 + 2118 + DMINFO("Discovered old metadata format; upgrading to extended metadata format"); 2117 2119 2118 2120 /* Table line is checked vs. authoritative superblock */ 2119 2121 rs_set_new(rs); ··· 2260 2258 if (!mddev->events && super_init_validation(rs, rdev)) 2261 2259 return -EINVAL; 2262 2260 2263 - if (le32_to_cpu(sb->compat_features) != FEATURE_FLAG_SUPPORTS_V190) { 2261 + if (le32_to_cpu(sb->compat_features) && 2262 + le32_to_cpu(sb->compat_features) != FEATURE_FLAG_SUPPORTS_V190) { 2264 2263 rs->ti->error = "Unable to assemble array: Unknown flag(s) in compatible feature flags"; 2265 2264 return -EINVAL; 2266 2265 } ··· 3649 3646 3650 3647 static struct target_type raid_target = { 3651 3648 .name = "raid", 3652 - .version = {1, 9, 0}, 3649 + .version = {1, 9, 1}, 3653 3650 .module = THIS_MODULE, 3654 3651 .ctr = raid_ctr, 3655 3652 .dtr = raid_dtr,
+3 -19
drivers/md/dm-raid1.c
··· 145 145 146 146 struct dm_raid1_bio_record { 147 147 struct mirror *m; 148 - /* if details->bi_bdev == NULL, details were not saved */ 149 148 struct dm_bio_details details; 150 149 region_t write_region; 151 150 }; ··· 1199 1200 struct dm_raid1_bio_record *bio_record = 1200 1201 dm_per_bio_data(bio, sizeof(struct dm_raid1_bio_record)); 1201 1202 1202 - bio_record->details.bi_bdev = NULL; 1203 - 1204 1203 if (rw == WRITE) { 1205 1204 /* Save region for mirror_end_io() handler */ 1206 1205 bio_record->write_region = dm_rh_bio_to_region(ms->rh, bio); ··· 1257 1260 } 1258 1261 1259 1262 if (error == -EOPNOTSUPP) 1260 - goto out; 1263 + return error; 1261 1264 1262 1265 if ((error == -EWOULDBLOCK) && (bio->bi_opf & REQ_RAHEAD)) 1263 - goto out; 1266 + return error; 1264 1267 1265 1268 if (unlikely(error)) { 1266 - if (!bio_record->details.bi_bdev) { 1267 - /* 1268 - * There wasn't enough memory to record necessary 1269 - * information for a retry or there was no other 1270 - * mirror in-sync. 1271 - */ 1272 - DMERR_LIMIT("Mirror read failed."); 1273 - return -EIO; 1274 - } 1275 - 1276 1269 m = bio_record->m; 1277 1270 1278 1271 DMERR("Mirror read failed from %s. Trying alternative device.", ··· 1278 1291 bd = &bio_record->details; 1279 1292 1280 1293 dm_bio_restore(bd, bio); 1281 - bio_record->details.bi_bdev = NULL; 1294 + bio->bi_error = 0; 1282 1295 1283 1296 queue_bio(ms, bio, rw); 1284 1297 return DM_ENDIO_INCOMPLETE; 1285 1298 } 1286 1299 DMERR("All replicated volumes dead, failing I/O"); 1287 1300 } 1288 - 1289 - out: 1290 - bio_record->details.bi_bdev = NULL; 1291 1301 1292 1302 return error; 1293 1303 }
+5 -2
drivers/md/dm-rq.c
··· 856 856 kthread_init_worker(&md->kworker); 857 857 md->kworker_task = kthread_run(kthread_worker_fn, &md->kworker, 858 858 "kdmwork-%s", dm_device_name(md)); 859 - if (IS_ERR(md->kworker_task)) 860 - return PTR_ERR(md->kworker_task); 859 + if (IS_ERR(md->kworker_task)) { 860 + int error = PTR_ERR(md->kworker_task); 861 + md->kworker_task = NULL; 862 + return error; 863 + } 861 864 862 865 elv_register_queue(md->queue); 863 866
+9 -15
drivers/md/dm-table.c
··· 695 695 696 696 tgt->type = dm_get_target_type(type); 697 697 if (!tgt->type) { 698 - DMERR("%s: %s: unknown target type", dm_device_name(t->md), 699 - type); 698 + DMERR("%s: %s: unknown target type", dm_device_name(t->md), type); 700 699 return -EINVAL; 701 700 } 702 701 703 702 if (dm_target_needs_singleton(tgt->type)) { 704 703 if (t->num_targets) { 705 - DMERR("%s: target type %s must appear alone in table", 706 - dm_device_name(t->md), type); 707 - return -EINVAL; 704 + tgt->error = "singleton target type must appear alone in table"; 705 + goto bad; 708 706 } 709 707 t->singleton = true; 710 708 } 711 709 712 710 if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) { 713 - DMERR("%s: target type %s may not be included in read-only tables", 714 - dm_device_name(t->md), type); 715 - return -EINVAL; 711 + tgt->error = "target type may not be included in a read-only table"; 712 + goto bad; 716 713 } 717 714 718 715 if (t->immutable_target_type) { 719 716 if (t->immutable_target_type != tgt->type) { 720 - DMERR("%s: immutable target type %s cannot be mixed with other target types", 721 - dm_device_name(t->md), t->immutable_target_type->name); 722 - return -EINVAL; 717 + tgt->error = "immutable target type cannot be mixed with other target types"; 718 + goto bad; 723 719 } 724 720 } else if (dm_target_is_immutable(tgt->type)) { 725 721 if (t->num_targets) { 726 - DMERR("%s: immutable target type %s cannot be mixed with other target types", 727 - dm_device_name(t->md), tgt->type->name); 728 - return -EINVAL; 722 + tgt->error = "immutable target type cannot be mixed with other target types"; 723 + goto bad; 729 724 } 730 725 t->immutable_target_type = tgt->type; 731 726 } ··· 735 740 */ 736 741 if (!adjoin(t, tgt)) { 737 742 tgt->error = "Gap in table"; 738 - r = -EINVAL; 739 743 goto bad; 740 744 } 741 745
+2 -2
drivers/md/dm.c
··· 1423 1423 if (md->bs) 1424 1424 bioset_free(md->bs); 1425 1425 1426 - cleanup_srcu_struct(&md->io_barrier); 1427 - 1428 1426 if (md->disk) { 1429 1427 spin_lock(&_minor_lock); 1430 1428 md->disk->private_data = NULL; ··· 1433 1435 1434 1436 if (md->queue) 1435 1437 blk_cleanup_queue(md->queue); 1438 + 1439 + cleanup_srcu_struct(&md->io_barrier); 1436 1440 1437 1441 if (md->bdev) { 1438 1442 bdput(md->bdev);