History

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

Linus Torvalds committed 10 years ago

Commit f51fdff2 parents 2161a2a 539294b4 files · +4 −5Browse files

Unified · Split

4 files
  1. drivers/scsi/hosts.c +2 −0
  2. drivers/scsi/scsi.c +0 −1
  3. drivers/scsi/scsi_priv.h +1 −0
  4. include/scsi/scsi_host.h +1 −4
drivers/scsi/hosts.c+2−0
@@ -486,6 +486,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) · 485 unmodified lines
486 else486 else
487 shost->dma_boundary = 0xffffffff;487 shost->dma_boundary = 0xffffffff;
488 488
489 shost->use_blk_mq = scsi_use_blk_mq;
490
489 device_initialize(&shost->shost_gendev);491 device_initialize(&shost->shost_gendev);
490 dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);492 dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
491 shost->shost_gendev.bus = &scsi_bus_type;493 shost->shost_gendev.bus = &scsi_bus_type;
drivers/scsi/scsi.c+0−1
@@ -1160,7 +1160,6 @@ bool scsi_use_blk_mq = true; · 1159 unmodified lines
1160bool scsi_use_blk_mq = false;1160bool scsi_use_blk_mq = false;
1161#endif1161#endif
1162module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);1162module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);
1163EXPORT_SYMBOL_GPL(scsi_use_blk_mq);
1164 1163
1165static int __init init_scsi(void)1164static int __init init_scsi(void)
1166{1165{
drivers/scsi/scsi_priv.h+1−0
@@ -29,6 +29,7 @@ extern int scsi_init_hosts(void); · 28 unmodified lines
29extern void scsi_exit_hosts(void);29extern void scsi_exit_hosts(void);
30 30
31/* scsi.c */31/* scsi.c */
32extern bool scsi_use_blk_mq;
32extern int scsi_setup_command_freelist(struct Scsi_Host *shost);33extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
33extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);34extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
34#ifdef CONFIG_SCSI_LOGGING35#ifdef CONFIG_SCSI_LOGGING
include/scsi/scsi_host.h+1−4
@@ -771,12 +771,9 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost) · 770 unmodified lines
771 shost->tmf_in_progress;771 shost->tmf_in_progress;
772}772}
773 773
774extern bool scsi_use_blk_mq;
775
776static inline bool shost_use_blk_mq(struct Scsi_Host *shost)774static inline bool shost_use_blk_mq(struct Scsi_Host *shost)
777{775{
778 return scsi_use_blk_mq;776 return shost->use_blk_mq;
779
780}777}
781 778
782extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);779extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);