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-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm

Pull device-mapper fixes from Alasdair G Kergon:
"Fix a couple of serious memory leaks in device-mapper thin
provisioning and tidy its MODULE_DESCRIPTION.

Mitigate occasional reported hangs associated with multipath scsi_dh
module loading."

* tag 'dm-3.4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
dm mpath: check if scsi_dh module already loaded before trying to load
dm thin: correct module description
dm thin: fix unprotected use of prepared_discards list
dm thin: reinstate missing mempool_free in cell_release_singleton

+14 -6
+2 -2
drivers/md/dm-mpath.c
··· 718 718 return 0; 719 719 720 720 m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); 721 - request_module("scsi_dh_%s", m->hw_handler_name); 722 - if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { 721 + if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name), 722 + "scsi_dh_%s", m->hw_handler_name)) { 723 723 ti->error = "unknown hardware handler type"; 724 724 ret = -EINVAL; 725 725 goto fail;
+12 -4
drivers/md/dm-thin.c
··· 279 279 280 280 hlist_del(&cell->list); 281 281 282 - bio_list_add(inmates, cell->holder); 283 - bio_list_merge(inmates, &cell->bios); 282 + if (inmates) { 283 + bio_list_add(inmates, cell->holder); 284 + bio_list_merge(inmates, &cell->bios); 285 + } 284 286 285 287 mempool_free(cell, prison->cell_pool); 286 288 } ··· 305 303 */ 306 304 static void __cell_release_singleton(struct cell *cell, struct bio *bio) 307 305 { 308 - hlist_del(&cell->list); 309 306 BUG_ON(cell->holder != bio); 310 307 BUG_ON(!bio_list_empty(&cell->bios)); 308 + 309 + __cell_release(cell, NULL); 311 310 } 312 311 313 312 static void cell_release_singleton(struct cell *cell, struct bio *bio) ··· 1180 1177 static void process_discard(struct thin_c *tc, struct bio *bio) 1181 1178 { 1182 1179 int r; 1180 + unsigned long flags; 1183 1181 struct pool *pool = tc->pool; 1184 1182 struct cell *cell, *cell2; 1185 1183 struct cell_key key, key2; ··· 1222 1218 m->bio = bio; 1223 1219 1224 1220 if (!ds_add_work(&pool->all_io_ds, &m->list)) { 1221 + spin_lock_irqsave(&pool->lock, flags); 1225 1222 list_add(&m->list, &pool->prepared_discards); 1223 + spin_unlock_irqrestore(&pool->lock, flags); 1226 1224 wake_worker(pool); 1227 1225 } 1228 1226 } else { ··· 2632 2626 if (h->all_io_entry) { 2633 2627 INIT_LIST_HEAD(&work); 2634 2628 ds_dec(h->all_io_entry, &work); 2629 + spin_lock_irqsave(&pool->lock, flags); 2635 2630 list_for_each_entry_safe(m, tmp, &work, list) 2636 2631 list_add(&m->list, &pool->prepared_discards); 2632 + spin_unlock_irqrestore(&pool->lock, flags); 2637 2633 } 2638 2634 2639 2635 mempool_free(h, pool->endio_hook_pool); ··· 2767 2759 module_init(dm_thin_init); 2768 2760 module_exit(dm_thin_exit); 2769 2761 2770 - MODULE_DESCRIPTION(DM_NAME "device-mapper thin provisioning target"); 2762 + MODULE_DESCRIPTION(DM_NAME " thin provisioning target"); 2771 2763 MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); 2772 2764 MODULE_LICENSE("GPL");