kernel_optimize_test/drivers/scsi
Dan Williams 0dba1314d4 scsi, block: fix duplicate bdi name registration crashes
Warnings of the following form occur because scsi reuses a devt number
while the block layer still has it referenced as the name of the bdi
[1]:

 WARNING: CPU: 1 PID: 93 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80
 sysfs: cannot create duplicate filename '/devices/virtual/bdi/8:192'
 [..]
 Call Trace:
  dump_stack+0x86/0xc3
  __warn+0xcb/0xf0
  warn_slowpath_fmt+0x5f/0x80
  ? kernfs_path_from_node+0x4f/0x60
  sysfs_warn_dup+0x62/0x80
  sysfs_create_dir_ns+0x77/0x90
  kobject_add_internal+0xb2/0x350
  kobject_add+0x75/0xd0
  device_add+0x15a/0x650
  device_create_groups_vargs+0xe0/0xf0
  device_create_vargs+0x1c/0x20
  bdi_register+0x90/0x240
  ? lockdep_init_map+0x57/0x200
  bdi_register_owner+0x36/0x60
  device_add_disk+0x1bb/0x4e0
  ? __pm_runtime_use_autosuspend+0x5c/0x70
  sd_probe_async+0x10d/0x1c0
  async_run_entry_fn+0x39/0x170

This is a brute-force fix to pass the devt release information from
sd_probe() to the locations where we register the bdi,
device_add_disk(), and unregister the bdi, blk_cleanup_queue().

Thanks to Omar for the quick reproducer script [2]. This patch survives
where an unmodified kernel fails in a few seconds.

[1]: https://marc.info/?l=linux-scsi&m=147116857810716&w=4
[2]: http://marc.info/?l=linux-block&m=148554717109098&w=2

Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Jan Kara <jack@suse.cz>
Reported-by: Omar Sandoval <osandov@osandov.com>
Tested-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2017-02-02 08:23:19 -07:00
..
aacraid Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
aic7xxx treewide: Fix printk() message errors 2016-12-14 10:54:27 +01:00
aic94xx scsi: aic94xx: Add a missing call to kfree 2016-11-29 11:21:49 -05:00
arcmsr Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
arm scsi: ncr5380: Use correct types for DMA routines 2016-11-08 17:29:48 -05:00
be2iscsi SCSI misc on 20161213 2016-12-14 10:49:33 -08:00
bfa Merge remote-tracking branch 'mkp-scsi/fixes' into fixes 2017-01-17 17:32:54 -05:00
bnx2fc scsi/bnx2fc: Convert to hotplug state machine 2016-12-25 10:47:42 +01:00
bnx2i scsi/bnx2i: Convert to hotplug state machine 2016-12-25 10:47:43 +01:00
csiostor scsi: csiostor: Fix completion usage 2016-09-14 13:19:15 -04:00
cxgbi scsi: libcxgbi: return error if interface is not up 2016-12-14 15:11:53 -05:00
cxlflash scsi: cxlflash: Migrate scsi command pointer to AFU command 2016-11-30 19:53:02 -05:00
device_handler scsi_dh_hp_sw: switch to scsi_execute_req_flags() 2017-01-27 15:08:35 -07:00
dpt
esas2r scsi: esas2r: don't reinitialize adapter's req_table 2016-08-25 22:28:17 -04:00
fcoe scsi: libfc: Remove fc_rport_init() 2016-11-08 17:29:56 -05:00
fnic scsi: fnic: Avoid sending reset to firmware when another reset is in progress 2017-01-05 20:41:31 -05:00
hisi_sas scsi: hisi_sas: support deferred probe for v2 hw 2016-12-07 18:55:58 -05:00
ibmvscsi scsi: ibmvscsi: add write memory barrier to CRQ processing 2016-12-08 17:04:25 -05:00
ibmvscsi_tgt ibmvscsis: Fix sleeping in interrupt context 2017-01-17 09:42:29 -08:00
isci scsi: isci: switch to pci_alloc_irq_vectors 2016-12-01 08:36:17 -05:00
libfc block: split scsi_request out of struct request 2017-01-27 15:08:35 -07:00
libsas block: split scsi_request out of struct request 2017-01-27 15:08:35 -07:00
lpfc scsi: lpfc: Set elsiocb contexts to NULL after freeing it 2017-01-17 14:14:32 -05:00
megaraid Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
mpt3sas block: split scsi_request out of struct request 2017-01-27 15:08:35 -07:00
mvsas SCSI misc on 20161213 2016-12-14 10:49:33 -08:00
osd block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
pcmcia
pm8001 scsi: pm8001: Mark symbols static where possible 2016-09-26 21:10:45 -04:00
qedi Merge remote-tracking branch 'mkp-scsi/4.10/scsi-fixes' into fixes 2016-12-26 20:32:48 -08:00
qla2xxx block: split scsi_request out of struct request 2017-01-27 15:08:35 -07:00
qla4xxx scsi: qla4xxx: switch to pci_alloc_irq_vectors 2016-12-07 18:58:58 -05:00
smartpqi block: introduce blk_rq_is_passthrough 2017-01-31 14:00:34 -07:00
snic scsi: snic: Return error code on memory allocation failure 2017-01-05 20:45:42 -05:00
sym53c8xx_2 scsi: sym53c8xx_2: Use complete() instead complete_all() 2016-09-14 13:19:29 -04:00
ufs ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
.gitignore
3w-9xxx.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
3w-9xxx.h scsi: Update 3ware driver email addresses 2016-12-14 15:25:12 -05:00
3w-sas.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
3w-sas.h scsi: Update 3ware driver email addresses 2016-12-14 15:25:12 -05:00
3w-xxxx.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
3w-xxxx.h scsi: Update 3ware driver email addresses 2016-12-14 15:25:12 -05:00
53c700_d.h_shipped
53c700.c scsi: remove current_cmnd field from struct scsi_device 2016-07-13 22:33:23 -04:00
53c700.h scsi: remove current_cmnd field from struct scsi_device 2016-07-13 22:33:23 -04:00
53c700.scr
a100u2w.c
a100u2w.h
a2091.c
a2091.h
a3000.c
a3000.h
a4000t.c
advansys.c scsi: advansys: fix build warning for PCI=n 2016-11-08 17:29:58 -05:00
aha152x.c
aha152x.h
aha1542.c
aha1542.h
aha1740.c
aha1740.h
am53c974.c
atari_scsi.c scsi: ncr5380: Use correct types for DMA routines 2016-11-08 17:29:48 -05:00
atp870u.c
atp870u.h
BusLogic.c
BusLogic.h
bvme6000_scsi.c
ch.c
constants.c scsi: fix upper bounds check of sense key in scsi_sense_key_string() 2016-08-16 00:49:32 -04:00
dc395x.c
dc395x.h
dmx3191d.c scsi: dmx3191d: use module_pci_driver 2016-11-16 20:43:50 -05:00
dpt_i2o.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
dpti.h
eata_generic.h
eata_pio.c eata_pio: missing break statement 2016-05-10 22:01:07 -04:00
eata_pio.h
eata.c
esp_scsi.c
esp_scsi.h
fdomain.c
fdomain.h
FlashPoint.c
g_NCR5380.c scsi: g_NCR5380: Autoprobe board IRQ by default 2016-12-08 16:58:22 -05:00
g_NCR5380.h scsi: g_NCR5380: Use probe_irq_*() for IRQ probing 2016-12-08 16:57:21 -05:00
gdth_ioctl.h
gdth_proc.c gdth: replace struct timeval with ktime_get_real_seconds() 2016-02-25 21:16:49 -05:00
gdth_proc.h
gdth.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
gdth.h
gvp11.c
gvp11.h
hosts.c scsi: allocate scsi_cmnd structures as part of struct request 2017-01-27 15:08:35 -07:00
hpsa_cmd.h scsi: hpsa: Check for vpd support before sending 2016-09-14 14:19:31 -04:00
hpsa.c block: introduce blk_rq_is_passthrough 2017-01-31 14:00:34 -07:00
hpsa.h SCSI misc on 20161213 2016-12-14 10:49:33 -08:00
hptiop.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
hptiop.h
imm.c imm: check parport_claim 2016-02-25 21:10:53 -05:00
imm.h
initio.c
initio.h
ipr.c scsi: ipr: Fix runaway IRQs when falling back from MSI to LSI 2016-11-30 19:58:04 -05:00
ipr.h scsi: ipr: Use pci_irq_allocate_vectors 2016-11-08 17:29:46 -05:00
ips.c scsi: ips: don't use custom hex_asc_upper[] table 2016-11-08 17:29:57 -05:00
ips.h Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
iscsi_boot_sysfs.c ibft: Expose iBFT acpi header via sysfs 2016-05-16 11:14:29 -04:00
iscsi_tcp.c scsi_tcp: block BH in TCP callbacks 2016-05-19 11:36:49 -07:00
iscsi_tcp.h
jazz_esp.c
Kconfig block: make scsi_request and scsi ioctl support optional 2017-01-31 10:53:05 -07:00
lasi700.c
libiscsi_tcp.c
libiscsi.c scsi: libiscsi: Fix locking in __iscsi_conn_send_pdu 2016-10-17 13:34:44 -04:00
mac_esp.c
mac_scsi.c scsi: ncr5380: Use correct types for DMA routines 2016-11-08 17:29:48 -05:00
mac53c94.c
mac53c94.h
Makefile scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework. 2016-12-14 14:56:28 -05:00
megaraid.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
megaraid.h
mesh.c
mesh.h
mvme16x_scsi.c
mvme147.c
mvme147.h
mvumi.c scsi: mvumi: use __maybe_unused to hide pm functions 2016-03-05 17:07:46 -05:00
mvumi.h
NCR_D700.c
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
ncr53c8xx.c
ncr53c8xx.h
NCR53c406a.c
NCR5380.c scsi: g_NCR5380: Use probe_irq_*() for IRQ probing 2016-12-08 16:57:21 -05:00
NCR5380.h scsi: g_NCR5380: Use probe_irq_*() for IRQ probing 2016-12-08 16:57:21 -05:00
nsp32_debug.c
nsp32_io.h
nsp32.c
nsp32.h
osst_detect.h
osst_options.h
osst.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
osst.h
pmcraid.c SCSI misc on 20161213 2016-12-14 10:49:33 -08:00
pmcraid.h
ppa.c scsi: ppa: use new parport device model 2016-02-23 21:27:02 -05:00
ppa.h
ps3rom.c
qla1280.c qla1280: Don't allocate 512kb of host tags 2016-04-30 09:25:26 -07:00
qla1280.h
qlogicfas.c
qlogicfas408.c
qlogicfas408.h
qlogicpti.c qlogicpti: Return correct error code 2016-03-01 20:06:49 -05:00
qlogicpti.h qlogicpti: Fix compiler warnings 2016-11-28 15:51:31 -05:00
raid_class.c
script_asm.pl
scsi_common.c scsi: add scsi_set_sense_field_pointer() 2016-04-04 12:07:42 -04:00
scsi_debug.c ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
scsi_devinfo.c scsi: scsi_devinfo: remove synchronous ALUA for NETAPP devices 2016-12-07 18:13:52 -05:00
scsi_dh.c scsi: Replace wrong device handler name for CLARiiON arrays 2016-10-11 17:56:51 -04:00
scsi_error.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
scsi_ioctl.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
scsi_lib_dma.c
scsi_lib.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
scsi_logging.c
scsi_logging.h
scsi_module.c
scsi_netlink.c
scsi_pm.c
scsi_priv.h scsi: allocate scsi_cmnd structures as part of struct request 2017-01-27 15:08:35 -07:00
scsi_proc.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
scsi_sas_internal.h scsi_transport_sas: add 'scsi_target_id' sysfs attribute 2016-03-14 21:05:04 -04:00
scsi_scan.c scsi: Remove one useless stack variable 2016-10-11 18:02:09 -04:00
scsi_sysctl.c
scsi_sysfs.c scsi: avoid a permanent stop of the scsi device's request queue 2016-12-14 15:51:17 -05:00
scsi_trace.c scsi-trace: define ZBC_IN and ZBC_OUT 2016-04-11 16:57:09 -04:00
scsi_transport_api.h
scsi_transport_fc.c block/bsg: move queue creation into bsg_setup_queue 2017-01-27 15:08:35 -07:00
scsi_transport_iscsi.c block/bsg: move queue creation into bsg_setup_queue 2017-01-27 15:08:35 -07:00
scsi_transport_sas.c block: split scsi_request out of struct request 2017-01-27 15:08:35 -07:00
scsi_transport_spi.c
scsi_transport_srp.c scsi: srp_transport: Move queuecommand() wait code to SCSI core 2016-11-29 11:21:27 -05:00
scsi_typedefs.h
scsi.c block: introduce blk_rq_is_passthrough 2017-01-31 14:00:34 -07:00
scsi.h
scsicam.c
sd_dif.c scsi: sd: Move DIF protection types to t10-pi.h 2016-09-15 09:51:14 -04:00
sd_zbc.c sd_zbc: Force use of READ16/WRITE16 2016-11-14 13:16:42 -07:00
sd.c scsi, block: fix duplicate bdi name registration crashes 2017-02-02 08:23:19 -07:00
sd.h sd: Implement support for ZBC devices 2016-10-18 19:49:11 -06:00
sense_codes.h scsi: move Additional Sense Codes to separate file 2016-04-11 16:57:09 -04:00
ses.c scsi: ses: Fix SAS device detection in enclosure 2017-01-17 13:58:57 -05:00
sg.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
sgiwd93.c
sim710.c scsi: sim710: fix build warning 2016-02-23 21:27:02 -05:00
sni_53c710.c
sr_ioctl.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
sr_vendor.c
sr.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
sr.h
st_options.h
st.c block: fold cmd_type into the REQ_OP_ space 2017-01-31 14:00:44 -07:00
st.h
stex.c stex: Add S3/S4 support 2016-02-23 21:27:02 -05:00
storvsc_drv.c scsi: storvsc: Payload buffer incorrectly sized for 32 bit kernels. 2016-11-30 11:38:24 -05:00
sun_esp.c
sun3_scsi_vme.c
sun3_scsi.c block: introduce blk_rq_is_passthrough 2017-01-31 14:00:34 -07:00
sun3_scsi.h
sun3x_esp.c
sym53c416.c
sym53c416.h
virtio_scsi.c SCSI misc on 20161006 2016-10-07 09:28:53 -07:00
vmw_pvscsi.c scsi: vmw_pvscsi: return SUCCESS for successful command aborts 2016-11-01 13:31:23 -04:00
vmw_pvscsi.h scsi: vmw_pvscsi: return SUCCESS for successful command aborts 2016-11-01 13:31:23 -04:00
wd33c93.c
wd33c93.h
wd719x.c drivers/scsi/wd719x.c: remove last declaration using DEFINE_PCI_DEVICE_TABLE 2016-09-01 17:52:01 -07:00
wd719x.h
xen-scsifront.c xen/scsifront: don't request a slot on the ring until request is ready 2016-12-09 10:59:13 +01:00
zalon.c
zorro7xx.c