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

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fix from James Bottomley:
"One final fix before 4.8.

There was a memory leak triggered by turning scsi mq off due to the
fact that we assume on host release that the already running hosts
weren't mq based because that's the state of the global flag (even
though they were).

Fix it by tracking this on a per host host basis"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: Avoid that toggling use_blk_mq triggers a memory leak

+4 -5
+2
drivers/scsi/hosts.c
··· 486 486 else 487 487 shost->dma_boundary = 0xffffffff; 488 488 489 + shost->use_blk_mq = scsi_use_blk_mq; 490 + 489 491 device_initialize(&shost->shost_gendev); 490 492 dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); 491 493 shost->shost_gendev.bus = &scsi_bus_type;
-1
drivers/scsi/scsi.c
··· 1160 1160 bool scsi_use_blk_mq = false; 1161 1161 #endif 1162 1162 module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO); 1163 - EXPORT_SYMBOL_GPL(scsi_use_blk_mq); 1164 1163 1165 1164 static int __init init_scsi(void) 1166 1165 {
+1
drivers/scsi/scsi_priv.h
··· 29 29 extern void scsi_exit_hosts(void); 30 30 31 31 /* scsi.c */ 32 + extern bool scsi_use_blk_mq; 32 33 extern int scsi_setup_command_freelist(struct Scsi_Host *shost); 33 34 extern void scsi_destroy_command_freelist(struct Scsi_Host *shost); 34 35 #ifdef CONFIG_SCSI_LOGGING
+1 -4
include/scsi/scsi_host.h
··· 771 771 shost->tmf_in_progress; 772 772 } 773 773 774 - extern bool scsi_use_blk_mq; 775 - 776 774 static inline bool shost_use_blk_mq(struct Scsi_Host *shost) 777 775 { 778 - return scsi_use_blk_mq; 779 - 776 + return shost->use_blk_mq; 780 777 } 781 778 782 779 extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);