Skip to content

Commit f51fdff

Browse files
committed
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
2 parents 2161a2a + 539294b commit f51fdff

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

drivers/scsi/hosts.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,8 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
486486
else
487487
shost->dma_boundary = 0xffffffff;
488488

489+
shost->use_blk_mq = scsi_use_blk_mq;
490+
489491
device_initialize(&shost->shost_gendev);
490492
dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
491493
shost->shost_gendev.bus = &scsi_bus_type;

drivers/scsi/scsi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,6 @@ bool scsi_use_blk_mq = true;
11601160
bool scsi_use_blk_mq = false;
11611161
#endif
11621162
module_param_named(use_blk_mq, scsi_use_blk_mq, bool, S_IWUSR | S_IRUGO);
1163-
EXPORT_SYMBOL_GPL(scsi_use_blk_mq);
11641163

11651164
static int __init init_scsi(void)
11661165
{

drivers/scsi/scsi_priv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ extern int scsi_init_hosts(void);
2929
extern void scsi_exit_hosts(void);
3030

3131
/* scsi.c */
32+
extern bool scsi_use_blk_mq;
3233
extern int scsi_setup_command_freelist(struct Scsi_Host *shost);
3334
extern void scsi_destroy_command_freelist(struct Scsi_Host *shost);
3435
#ifdef CONFIG_SCSI_LOGGING

include/scsi/scsi_host.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,9 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
771771
shost->tmf_in_progress;
772772
}
773773

774-
extern bool scsi_use_blk_mq;
775-
776774
static inline bool shost_use_blk_mq(struct Scsi_Host *shost)
777775
{
778-
return scsi_use_blk_mq;
779-
776+
return shost->use_blk_mq;
780777
}
781778

782779
extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);

0 commit comments

Comments
 (0)