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

Pull device mapper fixes from Mike Snitzer:

- a stable DM multipath fix to restore ability to pass integrity data

- two DM multipath fixes for a fix that was merged into 4.16-rc5

* tag 'for-4.16/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
dm mpath: fix passing integrity data
dm mpath: eliminate need to use scsi_device_from_queue
dm mpath: fix uninitialized 'pg_init_wait' waitqueue_head NULL pointer

+21 -22
+21 -22
drivers/md/dm-mpath.c
··· 22 22 #include <linux/time.h> 23 23 #include <linux/workqueue.h> 24 24 #include <linux/delay.h> 25 - #include <scsi/scsi_device.h> 26 25 #include <scsi/scsi_dh.h> 27 26 #include <linux/atomic.h> 28 27 #include <linux/blk-mq.h> ··· 222 223 223 224 dm_table_set_type(ti->table, m->queue_mode); 224 225 226 + /* 227 + * Init fields that are only used when a scsi_dh is attached 228 + * - must do this unconditionally (really doesn't hurt non-SCSI uses) 229 + */ 230 + set_bit(MPATHF_QUEUE_IO, &m->flags); 231 + atomic_set(&m->pg_init_in_progress, 0); 232 + atomic_set(&m->pg_init_count, 0); 233 + m->pg_init_delay_msecs = DM_PG_INIT_DELAY_DEFAULT; 234 + init_waitqueue_head(&m->pg_init_wait); 235 + 225 236 return 0; 226 237 } 227 238 ··· 340 331 set_bit(MPATHF_PG_INIT_REQUIRED, &m->flags); 341 332 set_bit(MPATHF_QUEUE_IO, &m->flags); 342 333 } else { 343 - /* FIXME: not needed if no scsi_dh is attached */ 344 334 clear_bit(MPATHF_PG_INIT_REQUIRED, &m->flags); 345 335 clear_bit(MPATHF_QUEUE_IO, &m->flags); 346 336 } ··· 804 796 return 0; 805 797 } 806 798 807 - static int setup_scsi_dh(struct block_device *bdev, struct multipath *m, char **error) 799 + static int setup_scsi_dh(struct block_device *bdev, struct multipath *m, 800 + const char *attached_handler_name, char **error) 808 801 { 809 802 struct request_queue *q = bdev_get_queue(bdev); 810 - const char *attached_handler_name; 811 803 int r; 812 804 813 805 if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags)) { 814 806 retain: 815 - attached_handler_name = scsi_dh_attached_handler_name(q, GFP_KERNEL); 816 807 if (attached_handler_name) { 817 808 /* 818 809 * Clear any hw_handler_params associated with a ··· 830 823 */ 831 824 kfree(m->hw_handler_name); 832 825 m->hw_handler_name = attached_handler_name; 833 - 834 - /* 835 - * Init fields that are only used when a scsi_dh is attached 836 - */ 837 - if (!test_and_set_bit(MPATHF_QUEUE_IO, &m->flags)) { 838 - atomic_set(&m->pg_init_in_progress, 0); 839 - atomic_set(&m->pg_init_count, 0); 840 - m->pg_init_delay_msecs = DM_PG_INIT_DELAY_DEFAULT; 841 - init_waitqueue_head(&m->pg_init_wait); 842 - } 843 826 } 844 827 } 845 828 ··· 865 868 int r; 866 869 struct pgpath *p; 867 870 struct multipath *m = ti->private; 868 - struct scsi_device *sdev; 871 + struct request_queue *q; 872 + const char *attached_handler_name; 869 873 870 874 /* we need at least a path arg */ 871 875 if (as->argc < 1) { ··· 885 887 goto bad; 886 888 } 887 889 888 - sdev = scsi_device_from_queue(bdev_get_queue(p->path.dev->bdev)); 889 - if (sdev) { 890 - put_device(&sdev->sdev_gendev); 890 + q = bdev_get_queue(p->path.dev->bdev); 891 + attached_handler_name = scsi_dh_attached_handler_name(q, GFP_KERNEL); 892 + if (attached_handler_name) { 891 893 INIT_DELAYED_WORK(&p->activate_path, activate_path_work); 892 - r = setup_scsi_dh(p->path.dev->bdev, m, &ti->error); 894 + r = setup_scsi_dh(p->path.dev->bdev, m, attached_handler_name, &ti->error); 893 895 if (r) { 894 896 dm_put_device(ti, p->path.dev); 895 897 goto bad; ··· 2020 2022 *---------------------------------------------------------------*/ 2021 2023 static struct target_type multipath_target = { 2022 2024 .name = "multipath", 2023 - .version = {1, 12, 0}, 2024 - .features = DM_TARGET_SINGLETON | DM_TARGET_IMMUTABLE, 2025 + .version = {1, 13, 0}, 2026 + .features = DM_TARGET_SINGLETON | DM_TARGET_IMMUTABLE | 2027 + DM_TARGET_PASSES_INTEGRITY, 2025 2028 .module = THIS_MODULE, 2026 2029 .ctr = multipath_ctr, 2027 2030 .dtr = multipath_dtr,