linux/drivers/scsi/bfa
Johannes Thumshirn 45349821ab scsi: bfa: fix access to bfad_im_port_s
Commit 'cd21c605b2cf ("scsi: fc: provide fc_bsg_to_shost() helper")'
changed access to bfa's 'struct bfad_im_port_s' by using shost_priv()
instead of shost->hostdata[0].

This lead to crashes like in the following back-trace:

task: ffff880046375300 ti: ffff8800a2ef8000 task.ti: ffff8800a2ef8000
RIP: e030:[<ffffffffa04c8252>]  [<ffffffffa04c8252>] bfa_fcport_get_attr+0x82/0x260 [bfa]
RSP: e02b:ffff8800a2efba10  EFLAGS: 00010046
RAX: 575f415441536432 RBX: ffff8800a2efba28 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8800a2efba28 RDI: ffff880004dc31d8
RBP: ffff880004dc31d8 R08: 0000000000000000 R09: 0000000000000001
R10: ffff88011fadc468 R11: 0000000000000001 R12: ffff880004dc31f0
R13: 0000000000000200 R14: ffff880004dc61d0 R15: ffff880004947a10
FS:  00007feb1e489700(0000) GS:ffff88011fac0000(0000) knlGS:0000000000000000
CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007ffe14e46c10 CR3: 00000000957b8000 CR4: 0000000000000660
Stack:
 ffff88001d4da000 ffff880004dc31c0 ffffffffa048a9df ffffffff81e56380
 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[] bfad_iocmd_ioc_get_info+0x4f/0x220 [bfa]
[] bfad_iocmd_handler+0xa00/0xd40 [bfa]
[] bfad_im_bsg_request+0xee/0x1b0 [bfa]
[] fc_bsg_dispatch+0x10b/0x1b0 [scsi_transport_fc]
[] bsg_request_fn+0x11d/0x1c0
[] __blk_run_queue+0x2f/0x40
[] blk_execute_rq_nowait+0xa8/0x160
[] blk_execute_rq+0x77/0x120
[] bsg_ioctl+0x1b6/0x200
[] do_vfs_ioctl+0x2cd/0x4a0
[] SyS_ioctl+0x74/0x80
[] entry_SYSCALL_64_fastpath+0x12/0x6d

Fixes: cd21c605b2 ("scsi: fc: provide fc_bsg_to_shost() helper")
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Michal Koutný <mkoutny@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2017-11-29 00:17:23 -05:00
..
bfa_core.c scsi: bfa: remove bfa_module_s madness 2017-04-19 22:12:14 -04:00
bfa_cs.h bfa: deinline __bfa_trc() and __bfa_trc32() 2016-02-23 21:27:02 -05:00
bfa_defs_fcs.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_defs_svc.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_defs.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_fc.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_fcbuild.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_fcbuild.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_fcpim.c scsi: bfa: remove bfa_module_s madness 2017-04-19 22:12:14 -04:00
bfa_fcpim.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_fcs_fcpim.c bfa: fix bfa_fcb_itnim_alloc() error handling 2016-05-09 22:18:42 -04:00
bfa_fcs_lport.c scsi: bfa: use designated initializers 2017-04-21 10:11:34 -04:00
bfa_fcs_rport.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_fcs.c scsi: bfa: remove bfa_fcs_mod_s 2017-01-09 23:34:58 -05:00
bfa_fcs.h scsi: bfa: remove bfa_fcs_mod_s 2017-01-09 23:34:58 -05:00
bfa_hw_cb.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_hw_ct.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_ioc_cb.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_ioc_ct.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_ioc.c scsi: bfa: remove bfa_module_s madness 2017-04-19 22:12:14 -04:00
bfa_ioc.h scsi: bfa: turn bfa_mem_{kva,dma}_setup into inline functions 2016-11-21 22:28:17 -05:00
bfa_modules.h scsi: bfa: remove bfa_module_s madness 2017-04-19 22:12:14 -04:00
bfa_plog.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_port.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_port.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa_svc.c scsi: bfa: remove bfa_module_s madness 2017-04-19 22:12:14 -04:00
bfa_svc.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfa.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfad_attr.c bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfad_bsg.c scsi: bfa: fix access to bfad_im_port_s 2017-11-29 00:17:23 -05:00
bfad_bsg.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfad_debugfs.c scsi: bfa: integer overflow in debugfs 2017-10-16 22:35:13 -04:00
bfad_drv.h scsi: bfa: Increase requested firmware version to 3.2.5.1 2017-01-05 20:47:29 -05:00
bfad_im.c scsi: bfa: move bus reset to target reset 2017-08-25 17:21:10 -04:00
bfad_im.h scsi: change FC drivers to use 'struct bsg_job' 2016-11-17 20:15:25 -05:00
bfad.c Merge remote-tracking branch 'mkp-scsi/fixes' into fixes 2017-01-08 19:20:35 -08:00
bfi_ms.h scripts/spelling.txt: add "aligment" pattern and fix typo instances 2017-02-27 18:43:46 -08:00
bfi_reg.h bfa: File header and user visible string changes 2015-12-02 17:07:38 -05:00
bfi.h scripts/spelling.txt: add "fimware" misspelling 2016-05-19 19:12:14 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00