08 Sep, 2017

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly updates of the usual suspects: lpfc, qla2xxx, hisi_sas,
    megaraid_sas, zfcp and a host of minor updates.

    The major driver change here is the elimination of the block based
    cciss driver in favour of the SCSI based hpsa driver (which now drives
    all the legacy cases cciss used to be required for). Plus a reset
    handler clean up and the redo of the SAS SMP handler to use bsg lib"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (279 commits)
    scsi: scsi-mq: Always unprepare before requeuing a request
    scsi: Show .retries and .jiffies_at_alloc in debugfs
    scsi: Improve requeuing behavior
    scsi: Call scsi_initialize_rq() for filesystem requests
    scsi: qla2xxx: Reset the logo flag, after target re-login.
    scsi: qla2xxx: Fix slow mem alloc behind lock
    scsi: qla2xxx: Clear fc4f_nvme flag
    scsi: qla2xxx: add missing includes for qla_isr
    scsi: qla2xxx: Fix an integer overflow in sysfs code
    scsi: aacraid: report -ENOMEM to upper layer from aac_convert_sgraw2()
    scsi: aacraid: get rid of one level of indentation
    scsi: aacraid: fix indentation errors
    scsi: storvsc: fix memory leak on ring buffer busy
    scsi: scsi_transport_sas: switch to bsg-lib for SMP passthrough
    scsi: smartpqi: remove the smp_handler stub
    scsi: hpsa: remove the smp_handler stub
    scsi: bsg-lib: pass the release callback through bsg_setup_queue
    scsi: Rework handling of scsi_device.vpd_pg8[03]
    scsi: Rework the code for caching Vital Product Data (VPD)
    scsi: rcu: Introduce rcu_swap_protected()
    ...

    Linus Torvalds
     

30 Aug, 2017

1 commit


24 Aug, 2017

1 commit

  • Since we split the scsi_request out of struct request bsg fails to
    provide a reply-buffer for the drivers. This was done via the pointer
    for sense-data, that is not preallocated anymore.

    Failing to allocate/assign it results in illegal dereferences because
    LLDs use this pointer unquestioned.

    An example panic on s390x, using the zFCP driver, looks like this (I had
    debugging on, otherwise NULL-pointer dereferences wouldn't even panic on
    s390x):

    Unable to handle kernel pointer dereference in virtual kernel address space
    Failing address: 6b6b6b6b6b6b6000 TEID: 6b6b6b6b6b6b6403
    Fault in home space mode while using kernel ASCE.
    AS:0000000001590007 R3:0000000000000024
    Oops: 0038 ilc:2 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    Modules linked in:
    CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.12.0-bsg-regression+ #3
    Hardware name: IBM 2964 N96 702 (z/VM 6.4.0)
    task: 0000000065cb0100 task.stack: 0000000065cb4000
    Krnl PSW : 0704e00180000000 000003ff801e4156 (zfcp_fc_ct_els_job_handler+0x16/0x58 [zfcp])
    R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3
    Krnl GPRS: 0000000000000001 000000005fa9d0d0 000000005fa9d078 0000000000e16866
    000003ff00000290 6b6b6b6b6b6b6b6b 0000000059f78f00 000000000000000f
    00000000593a0958 00000000593a0958 0000000060d88800 000000005ddd4c38
    0000000058b50100 07000000659cba08 000003ff801e8556 00000000659cb9a8
    Krnl Code: 000003ff801e4146: e31020500004 lg %r1,80(%r2)
    000003ff801e414c: 58402040 l %r4,64(%r2)
    #000003ff801e4150: e35020200004 lg %r5,32(%r2)
    >000003ff801e4156: 50405004 st %r4,4(%r5)
    000003ff801e415a: e54c50080000 mvhi 8(%r5),0
    000003ff801e4160: e33010280012 lt %r3,40(%r1)
    000003ff801e4166: a718fffb lhi %r1,-5
    000003ff801e416a: 1803 lr %r0,%r3
    Call Trace:
    ([] zfcp_fsf_req_complete+0x726/0x768 [zfcp])
    [] zfcp_fsf_reqid_check+0x102/0x180 [zfcp]
    [] zfcp_qdio_int_resp+0x230/0x278 [zfcp]
    [] qdio_kick_handler+0x2ae/0x2c8
    [] __tiqdio_inbound_processing+0x406/0xc10
    [] tasklet_action+0x15a/0x1d8
    [] __do_softirq+0x3ec/0x848
    [] irq_exit+0x74/0xf8
    [] do_IRQ+0xba/0xf0
    [] io_int_handler+0x104/0x2d4
    [] enabled_wait+0xb6/0x188
    ([] enabled_wait+0x9e/0x188)
    [] arch_cpu_idle+0x32/0x50
    [] default_idle_call+0x52/0x68
    [] do_idle+0x102/0x188
    [] cpu_startup_entry+0x3e/0x48
    [] smp_start_secondary+0x11c/0x130
    [] restart_int_handler+0x62/0x78
    [] (null)
    INFO: lockdep is turned off.
    Last Breaking-Event-Address:
    [] zfcp_fc_ct_job_handler+0x3e/0x48 [zfcp]

    Kernel panic - not syncing: Fatal exception in interrupt

    This patch moves bsg-lib to allocate and setup struct bsg_job ahead of
    time, including the allocation of a buffer for the reply-data.

    This means, struct bsg_job is not allocated separately anymore, but as part
    of struct request allocation - similar to struct scsi_cmd. Reflect this in
    the function names that used to handle creation/destruction of struct
    bsg_job.

    Reported-by: Steffen Maier
    Suggested-by: Christoph Hellwig
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Benjamin Block
    Fixes: 82ed4db499b8 ("block: split scsi_request out of struct request")
    Cc: #4.11+
    Signed-off-by: Jens Axboe

    Benjamin Block
     

28 Jan, 2017

1 commit


18 Nov, 2016

5 commits


06 Dec, 2012

1 commit


25 Jun, 2012

1 commit

  • iscsi_remove_host() uses bsg_remove_queue() which implements custom
    queue draining. fc_bsg_remove() open-codes mostly identical logic.

    The draining logic isn't correct in that blk_stop_queue() doesn't
    prevent new requests from being queued - it just stops processing, so
    nothing prevents new requests to be queued after the logic determines
    that the queue is drained.

    blk_cleanup_queue() now implements proper queue draining and these
    custom draining logics aren't necessary. Drop them and use
    bsg_unregister_queue() + blk_cleanup_queue() instead.

    Signed-off-by: Tejun Heo
    Reviewed-by: Mike Christie
    Acked-by: Vivek Goyal
    Cc: James Bottomley
    Cc: James Smart
    Signed-off-by: Jens Axboe

    Tejun Heo
     

01 Aug, 2011

1 commit

  • This moves the FC classes bsg code to the block layer and
    makes it a lib so that other classes like iscsi and SAS can use it.

    It is helpful because working with the request queue, bios,
    creating scatterlists, etc are a pain that the LLD does not
    have to worry about with normal IOs and should not have to
    worry about for bsg requests.

    Signed-off-by: Mike Christie
    Signed-off-by: Jens Axboe

    Mike Christie