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 'for-4.19/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm

Mike writes:
"device mapper fixes

- Fix a DM thinp __udivdi3 undefined on 32-bit bug introduced during
4.19 merge window.

- Fix leak and dangling pointer in DM multipath's scsi_dh related code.

- A couple stable@ fixes for DM cache's resize support.

- A DM raid fix to remove "const" from decipher_sync_action()'s return
type."

* tag 'for-4.19/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm cache: fix resize crash if user doesn't reload cache table
dm cache metadata: ignore hints array being too small during resize
dm raid: remove bogus const from decipher_sync_action() return type
dm mpath: fix attached_handler_name leak and dangling hw_handler_name pointer
dm thin metadata: fix __udivdi3 undefined on 32-bit

+20 -15
+2 -2
drivers/md/dm-cache-metadata.c
··· 1455 1455 if (hints_valid) { 1456 1456 r = dm_array_cursor_next(&cmd->hint_cursor); 1457 1457 if (r) { 1458 - DMERR("dm_array_cursor_next for hint failed"); 1459 - goto out; 1458 + dm_array_cursor_end(&cmd->hint_cursor); 1459 + hints_valid = false; 1460 1460 } 1461 1461 } 1462 1462
+7 -2
drivers/md/dm-cache-target.c
··· 3009 3009 3010 3010 static bool can_resize(struct cache *cache, dm_cblock_t new_size) 3011 3011 { 3012 - if (from_cblock(new_size) > from_cblock(cache->cache_size)) 3013 - return true; 3012 + if (from_cblock(new_size) > from_cblock(cache->cache_size)) { 3013 + if (cache->sized) { 3014 + DMERR("%s: unable to extend cache due to missing cache table reload", 3015 + cache_device_name(cache)); 3016 + return false; 3017 + } 3018 + } 3014 3019 3015 3020 /* 3016 3021 * We can't drop a dirty block when shrinking the cache.
+8 -6
drivers/md/dm-mpath.c
··· 806 806 } 807 807 808 808 static int setup_scsi_dh(struct block_device *bdev, struct multipath *m, 809 - const char *attached_handler_name, char **error) 809 + const char **attached_handler_name, char **error) 810 810 { 811 811 struct request_queue *q = bdev_get_queue(bdev); 812 812 int r; 813 813 814 814 if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags)) { 815 815 retain: 816 - if (attached_handler_name) { 816 + if (*attached_handler_name) { 817 817 /* 818 818 * Clear any hw_handler_params associated with a 819 819 * handler that isn't already attached. 820 820 */ 821 - if (m->hw_handler_name && strcmp(attached_handler_name, m->hw_handler_name)) { 821 + if (m->hw_handler_name && strcmp(*attached_handler_name, m->hw_handler_name)) { 822 822 kfree(m->hw_handler_params); 823 823 m->hw_handler_params = NULL; 824 824 } ··· 830 830 * handler instead of the original table passed in. 831 831 */ 832 832 kfree(m->hw_handler_name); 833 - m->hw_handler_name = attached_handler_name; 833 + m->hw_handler_name = *attached_handler_name; 834 + *attached_handler_name = NULL; 834 835 } 835 836 } 836 837 ··· 868 867 struct pgpath *p; 869 868 struct multipath *m = ti->private; 870 869 struct request_queue *q; 871 - const char *attached_handler_name; 870 + const char *attached_handler_name = NULL; 872 871 873 872 /* we need at least a path arg */ 874 873 if (as->argc < 1) { ··· 891 890 attached_handler_name = scsi_dh_attached_handler_name(q, GFP_KERNEL); 892 891 if (attached_handler_name || m->hw_handler_name) { 893 892 INIT_DELAYED_WORK(&p->activate_path, activate_path_work); 894 - r = setup_scsi_dh(p->path.dev->bdev, m, attached_handler_name, &ti->error); 893 + r = setup_scsi_dh(p->path.dev->bdev, m, &attached_handler_name, &ti->error); 895 894 if (r) { 896 895 dm_put_device(ti, p->path.dev); 897 896 goto bad; ··· 906 905 907 906 return p; 908 907 bad: 908 + kfree(attached_handler_name); 909 909 free_pgpath(p); 910 910 return ERR_PTR(r); 911 911 }
+1 -1
drivers/md/dm-raid.c
··· 3353 3353 }; 3354 3354 3355 3355 /* Return enum sync_state for @mddev derived from @recovery flags */ 3356 - static const enum sync_state decipher_sync_action(struct mddev *mddev, unsigned long recovery) 3356 + static enum sync_state decipher_sync_action(struct mddev *mddev, unsigned long recovery) 3357 3357 { 3358 3358 if (test_bit(MD_RECOVERY_FROZEN, &recovery)) 3359 3359 return st_frozen;
+2 -4
drivers/md/dm-thin-metadata.c
··· 832 832 if (r) { 833 833 DMERR("could not get size of metadata device"); 834 834 pmd->metadata_reserve = max_blocks; 835 - } else { 836 - sector_div(total, 10); 837 - pmd->metadata_reserve = min(max_blocks, total); 838 - } 835 + } else 836 + pmd->metadata_reserve = min(max_blocks, div_u64(total, 10)); 839 837 } 840 838 841 839 struct dm_pool_metadata *dm_pool_metadata_open(struct block_device *bdev,