13 Jan, 2021

1 commit

  • [ Upstream commit e6044f714b256259df9611ff49af433e5411c5c8 ]

    Instead of submitting all SCSI commands submitted with scsi_execute() to a
    SCSI device if rpm_status != RPM_ACTIVE, only submit RQF_PM (power
    management requests) if rpm_status != RPM_ACTIVE. This patch makes the SCSI
    core handle the runtime power management status (rpm_status) as it should
    be handled.

    Link: https://lore.kernel.org/r/20201209052951.16136-7-bvanassche@acm.org
    Cc: Can Guo
    Cc: Stanley Chu
    Cc: Alan Stern
    Cc: Ming Lei
    Cc: Rafael J. Wysocki
    Cc: Martin Kepplinger
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Jens Axboe
    Reviewed-by: Can Guo
    Signed-off-by: Bart Van Assche
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Bart Van Assche
     

30 Dec, 2020

1 commit

  • [ Upstream commit 2e4209b3806cda9b89c30fd5e7bfecb7044ec78b ]

    The current implementation of scsi_vpd_lun_id() uses the designator length
    as an implicit measure of priority. This works most of the time, but not
    always. For example, some Hitachi storage arrays return this in VPD 0x83:

    VPD INQUIRY: Device Identification page
    Designation descriptor number 1, descriptor length: 24
    designator_type: T10 vendor identification, code_set: ASCII
    associated with the Addressed logical unit
    vendor id: HITACHI
    vendor specific: 5030C3502025
    Designation descriptor number 2, descriptor length: 6
    designator_type: vendor specific [0x0], code_set: Binary
    associated with the Target port
    vendor specific: 08 03
    Designation descriptor number 3, descriptor length: 20
    designator_type: NAA, code_set: Binary
    associated with the Addressed logical unit
    NAA 6, IEEE Company_id: 0x60e8
    Vendor Specific Identifier: 0x7c35000
    Vendor Specific Identifier Extension: 0x30c35000002025
    [0x60060e8007c350000030c35000002025]

    The current code would use the first descriptor because it's longer than
    the NAA descriptor. But this is wrong, the kernel is supposed to prefer NAA
    descriptors over T10 vendor ID. Designator length should only be used to
    compare designators of the same type.

    This patch addresses the issue by separating designator priority and
    length.

    Link: https://lore.kernel.org/r/20201029170846.14786-1-mwilck@suse.com
    Fixes: 9983bed3907c ("scsi: Add scsi_vpd_lun_id()")
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Martin Wilck
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Sasha Levin

    Martin Wilck
     

08 Dec, 2020

1 commit

  • When queuing I/O request to LLD, STS_RESOURCE may be returned because:

    - Host is in recovery or blocked

    - Target queue throttling or target is blocked

    - LLD rejection

    In these scenarios BLK_STS_DEV_RESOURCE is returned to the block layer to
    avoid an unnecessary re-run of the queue. However, all of the requests
    queued to this SCSI device may complete immediately after reading
    'sdev->device_busy' and BLK_STS_DEV_RESOURCE is returned to block layer. In
    that case the current I/O won't get a chance to get queued since it is
    invisible at that time for both scsi_run_queue_async() and blk-mq's
    RESTART.

    Fix the issue by not returning BLK_STS_DEV_RESOURCE in this situation.

    Link: https://lore.kernel.org/r/20201202100419.525144-1-ming.lei@redhat.com
    Fixes: 86ff7c2a80cd ("blk-mq: introduce BLK_STS_DEV_RESOURCE")
    Cc: Hannes Reinecke
    Cc: Sumit Saxena
    Cc: Kashyap Desai
    Cc: Bart Van Assche
    Cc: Ewan Milne
    Cc: Long Li
    Reported-by: John Garry
    Tested-by: "chenxiang (M)"
    Signed-off-by: Ming Lei
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

25 Oct, 2020

1 commit

  • Pull block fixes from Jens Axboe:

    - NVMe pull request from Christoph
    - rdma error handling fixes (Chao Leng)
    - fc error handling and reconnect fixes (James Smart)
    - fix the qid displace when tracing ioctl command (Keith Busch)
    - don't use BLK_MQ_REQ_NOWAIT for passthru (Chaitanya Kulkarni)
    - fix MTDT for passthru (Logan Gunthorpe)
    - blacklist Write Same on more devices (Kai-Heng Feng)
    - fix an uninitialized work struct (zhenwei pi)"

    - lightnvm out-of-bounds fix (Colin)

    - SG allocation leak fix (Doug)

    - rnbd fixes (Gioh, Guoqing, Jack)

    - zone error translation fixes (Keith)

    - kerneldoc markup fix (Mauro)

    - zram lockdep fix (Peter)

    - Kill unused io_context members (Yufen)

    - NUMA memory allocation cleanup (Xianting)

    - NBD config wakeup fix (Xiubo)

    * tag 'block-5.10-2020-10-24' of git://git.kernel.dk/linux-block: (27 commits)
    block: blk-mq: fix a kernel-doc markup
    nvme-fc: shorten reconnect delay if possible for FC
    nvme-fc: wait for queues to freeze before calling update_hr_hw_queues
    nvme-fc: fix error loop in create_hw_io_queues
    nvme-fc: fix io timeout to abort I/O
    null_blk: use zone status for max active/open
    nvmet: don't use BLK_MQ_REQ_NOWAIT for passthru
    nvmet: cleanup nvmet_passthru_map_sg()
    nvmet: limit passthru MTDS by BIO_MAX_PAGES
    nvmet: fix uninitialized work for zero kato
    nvme-pci: disable Write Zeroes on Sandisk Skyhawk
    nvme: use queuedata for nvme_req_qid
    nvme-rdma: fix crash due to incorrect cqe
    nvme-rdma: fix crash when connect rejected
    block: remove unused members for io_context
    blk-mq: remove the calling of local_memory_node()
    zram: Fix __zram_bvec_{read,write}() locking order
    skd_main: remove unused including
    sgl_alloc_order: fix memory leak
    lightnvm: fix out-of-bounds write to array devices->info[]
    ...

    Linus Torvalds
     

24 Oct, 2020

1 commit

  • Pull more SCSI updates from James Bottomley:
    "The set of core changes here is Christoph's submission path cleanups.

    These introduced a couple of regressions when first proposed so they
    got held over from the initial merge window pull request to give more
    testing time, which they've now had and Syzbot has confirmed the
    regression it detected is fixed.

    The other main changes are two driver updates (arcmsr, pm80xx) and
    assorted minor clean ups"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (38 commits)
    scsi: qla2xxx: Fix return of uninitialized value in rval
    scsi: core: Set sc_data_direction to DMA_NONE for no-transfer commands
    scsi: sr: Initialize ->cmd_len
    scsi: arcmsr: Update driver version to v1.50.00.02-20200819
    scsi: arcmsr: Add support for ARC-1886 series RAID controllers
    scsi: arcmsr: Fix device hot-plug monitoring timer stop
    scsi: arcmsr: Remove unnecessary syntax
    scsi: pm80xx: Driver version update
    scsi: pm80xx: Increase the number of outstanding I/O supported to 1024
    scsi: pm80xx: Remove DMA memory allocation for ccb and device structures
    scsi: pm80xx: Increase number of supported queues
    scsi: sym53c8xx_2: Fix sizeof() mismatch
    scsi: isci: Fix a typo in a comment
    scsi: qla4xxx: Fix inconsistent format argument type
    scsi: myrb: Fix inconsistent format argument types
    scsi: myrb: Remove redundant assignment to variable timeout
    scsi: bfa: Fix error return in bfad_pci_init()
    scsi: fcoe: Simplify the return expression of fcoe_sysfs_setup()
    scsi: snic: Simplify the return expression of svnic_cq_alloc()
    scsi: fnic: Simplify the return expression of vnic_wq_copy_alloc()
    ...

    Linus Torvalds
     

15 Oct, 2020

1 commit

  • Pull SCSI updates from James Bottomley:
    "The usual driver updates (ufs, qla2xxx, tcmu, ibmvfc, lpfc, smartpqi,
    hisi_sas, qedi, qedf, mpt3sas) and minor bug fixes.

    There are only three core changes: adding sense codes, cleaning up
    noretry and adding an option for limitless retries"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (226 commits)
    scsi: hisi_sas: Recover PHY state according to the status before reset
    scsi: hisi_sas: Filter out new PHY up events during suspend
    scsi: hisi_sas: Add device link between SCSI devices and hisi_hba
    scsi: hisi_sas: Add check for methods _PS0 and _PR0
    scsi: hisi_sas: Add controller runtime PM support for v3 hw
    scsi: hisi_sas: Switch to new framework to support suspend and resume
    scsi: hisi_sas: Use hisi_hba->cq_nvecs for calling calling synchronize_irq()
    scsi: qedf: Remove redundant assignment to variable 'rc'
    scsi: lpfc: Remove unneeded variable 'status' in lpfc_fcp_cpu_map_store()
    scsi: snic: Convert to use DEFINE_SEQ_ATTRIBUTE macro
    scsi: qla4xxx: Delete unneeded variable 'status' in qla4xxx_process_ddb_changed
    scsi: sun_esp: Use module_platform_driver to simplify the code
    scsi: sun3x_esp: Use module_platform_driver to simplify the code
    scsi: sni_53c710: Use module_platform_driver to simplify the code
    scsi: qlogicpti: Use module_platform_driver to simplify the code
    scsi: mac_esp: Use module_platform_driver to simplify the code
    scsi: jazz_esp: Use module_platform_driver to simplify the code
    scsi: mvumi: Fix error return in mvumi_io_attach()
    scsi: lpfc: Drop nodelist reference on error in lpfc_gen_req()
    scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()
    ...

    Linus Torvalds
     

14 Oct, 2020

1 commit

  • ZBC or ZAC disks that have a limit on the number of open zones may fail
    a zone open command or a write to a zone that is not already implicitly
    or explicitly open if the total number of open zones is already at the
    maximum allowed.

    For these operations, instead of returning the generic BLK_STS_IOERR,
    return BLK_STS_ZONE_OPEN_RESOURCE which is returned as -ETOOMANYREFS to
    the I/O issuer, allowing the device user to act appropriately on these
    relatively benign zone resource errors.

    Acked-by: Martin K. Petersen
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Johannes Thumshirn
    Signed-off-by: Damien Le Moal
    Signed-off-by: Keith Busch
    Signed-off-by: Jens Axboe

    Damien Le Moal
     

09 Oct, 2020

1 commit


08 Oct, 2020

9 commits


06 Oct, 2020

1 commit

  • Add Host and host template flag 'host_tagset' so hostwide tagset can be
    shared on multiple reply queues after the SCSI device's reply queue is
    converted to blk-mq hw queue.

    [jpg: Update comment on .can_queue and add Scsi_Host.host_tagset]

    Signed-off-by: Hannes Reinecke
    Signed-off-by: John Garry
    Tested-by: Don Brace #SCSI resv cmds patches used
    Tested-by: Douglas Gilbert
    Acked-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Hannes Reinecke
     

03 Oct, 2020

1 commit

  • Add infinite retry support to SCSI midlayer by combining common checks for
    retries into some helper functions, and then checking for the
    -1/SCSI_CMD_RETRIES_NO_LIMIT.

    Link: https://lore.kernel.org/r/1601566554-26752-2-git-send-email-michael.christie@oracle.com
    Reviewed-by: Bart Van Assche
    Signed-off-by: Mike Christie
    Signed-off-by: Martin K. Petersen

    Mike Christie
     

16 Sep, 2020

1 commit

  • The request queue is currently run unconditionally in scsi_end_request() if
    both target queue and host queue are ready.

    Recently Long Li reported that cost of a queue run can be very heavy in
    case of high queue depth. Improve this situation by only running the
    request queue when this LUN is busy.

    Link: https://lore.kernel.org/r/20200910075056.36509-1-ming.lei@redhat.com
    Reported-by: Long Li
    Tested-by: Long Li
    Tested-by: Kashyap Desai
    Reviewed-by: Bart Van Assche
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Ewan D. Milne
    Reviewed-by: John Garry
    Signed-off-by: Ming Lei
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

07 Aug, 2020

1 commit

  • Pull SCSI updates from James Bottomley:
    "This consists of the usual driver updates (ufs, qla2xxx, tcmu, lpfc,
    hpsa, zfcp, scsi_debug) and minor bug fixes.

    We also have a huge docbook fix update like most other subsystems and
    no major update to the core (the few non trivial updates are either
    minor fixes or removing an unused feature [scsi_sdb_cache])"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (307 commits)
    scsi: scsi_transport_srp: Sanitize scsi_target_block/unblock sequences
    scsi: ufs-mediatek: Apply DELAY_AFTER_LPM quirk to Micron devices
    scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM"
    scsi: virtio-scsi: Correctly handle the case where all LUNs are unplugged
    scsi: scsi_debug: Implement tur_ms_to_ready parameter
    scsi: scsi_debug: Fix request sense
    scsi: lpfc: Fix typo in comment for ULP
    scsi: ufs-mediatek: Prevent LPM operation on undeclared VCC
    scsi: iscsi: Do not put host in iscsi_set_flashnode_param()
    scsi: hpsa: Correct ctrl queue depth
    scsi: target: tcmu: Make TMR notification optional
    scsi: target: tcmu: Implement tmr_notify callback
    scsi: target: tcmu: Fix and simplify timeout handling
    scsi: target: tcmu: Factor out new helper ring_insert_padding
    scsi: target: tcmu: Do not queue aborted commands
    scsi: target: tcmu: Use priv pointer in se_cmd
    scsi: target: Add tmr_notify backend function
    scsi: target: Modify core_tmr_abort_task()
    scsi: target: iscsi: Fix inconsistent debug message
    scsi: target: iscsi: Fix login error when receiving
    ...

    Linus Torvalds
     

04 Aug, 2020

1 commit

  • Pull core block updates from Jens Axboe:
    "Good amount of cleanups and tech debt removals in here, and as a
    result, the diffstat shows a nice net reduction in code.

    - Softirq completion cleanups (Christoph)

    - Stop using ->queuedata (Christoph)

    - Cleanup bd claiming (Christoph)

    - Use check_events, moving away from the legacy media change
    (Christoph)

    - Use inode i_blkbits consistently (Christoph)

    - Remove old unused writeback congestion bits (Christoph)

    - Cleanup/unify submission path (Christoph)

    - Use bio_uninit consistently, instead of bio_disassociate_blkg
    (Christoph)

    - sbitmap cleared bits handling (John)

    - Request merging blktrace event addition (Jan)

    - sysfs add/remove race fixes (Luis)

    - blk-mq tag fixes/optimizations (Ming)

    - Duplicate words in comments (Randy)

    - Flush deferral cleanup (Yufen)

    - IO context locking/retry fixes (John)

    - struct_size() usage (Gustavo)

    - blk-iocost fixes (Chengming)

    - blk-cgroup IO stats fixes (Boris)

    - Various little fixes"

    * tag 'for-5.9/block-20200802' of git://git.kernel.dk/linux-block: (135 commits)
    block: blk-timeout: delete duplicated word
    block: blk-mq-sched: delete duplicated word
    block: blk-mq: delete duplicated word
    block: genhd: delete duplicated words
    block: elevator: delete duplicated word and fix typos
    block: bio: delete duplicated words
    block: bfq-iosched: fix duplicated word
    iocost_monitor: start from the oldest usage index
    iocost: Fix check condition of iocg abs_vdebt
    block: Remove callback typedefs for blk_mq_ops
    block: Use non _rcu version of list functions for tag_set_list
    blk-cgroup: show global disk stats in root cgroup io.stat
    blk-cgroup: make iostat functions visible to stat printing
    block: improve discard bio alignment in __blkdev_issue_discard()
    block: change REQ_OP_ZONE_RESET and REQ_OP_ZONE_RESET_ALL to be odd numbers
    block: defer flush request no matter whether we have elevator
    block: make blk_timeout_init() static
    block: remove retry loop in ioc_release_fn()
    block: remove unnecessary ioc nested locking
    block: integrate bd_start_claiming into __blkdev_get
    ...

    Linus Torvalds
     

25 Jul, 2020

1 commit

  • The scsi_host_block() case was missing in commit 4dea170f4fb2 ("scsi: core:
    Fix incorrect usage of shost_for_each_device").

    Link: https://lore.kernel.org/r/20200717090921.29243-1-yebin10@huawei.com
    Fixes: 2bb955840c1d ("scsi: core: add scsi_host_(block,unblock) helper function")
    Fixes: 4dea170f4fb2 ("scsi: core: Fix incorrect usage of shost_for_each_device")
    Signed-off-by: Ye Bin
    Signed-off-by: Martin K. Petersen

    Ye Bin
     

21 Jul, 2020

1 commit

  • I/O requests may be held in scheduler queue because of resource contention.
    The starvation scenario was handled properly in the regular completion
    path but we failed to account for it during I/O submission. This lead to
    the hang captured below. Make sure we run the queue when resource
    contention is encountered in the submission path.

    [ 39.054963] scsi 13:0:0:0: rejecting I/O to dead device
    [ 39.058700] scsi 13:0:0:0: rejecting I/O to dead device
    [ 39.087855] sd 13:0:0:1: [sdd] Synchronizing SCSI cache
    [ 39.088909] scsi 13:0:0:1: rejecting I/O to dead device
    [ 39.095351] scsi 13:0:0:1: rejecting I/O to dead device
    [ 39.096962] scsi 13:0:0:1: rejecting I/O to dead device
    [ 247.021859] INFO: task scsi-stress-rem:813 blocked for more than 122 seconds.
    [ 247.023258] Not tainted 5.8.0-rc2 #8
    [ 247.024069] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
    [ 247.025331] scsi-stress-rem D 0 813 802 0x00004000
    [ 247.025334] Call Trace:
    [ 247.025354] __schedule+0x504/0x55f
    [ 247.027987] schedule+0x72/0xa8
    [ 247.027991] blk_mq_freeze_queue_wait+0x63/0x8c
    [ 247.027994] ? do_wait_intr_irq+0x7a/0x7a
    [ 247.027996] blk_cleanup_queue+0x4b/0xc9
    [ 247.028000] __scsi_remove_device+0xf6/0x14e
    [ 247.028002] scsi_remove_device+0x21/0x2b
    [ 247.029037] sdev_store_delete+0x58/0x7c
    [ 247.029041] kernfs_fop_write+0x10d/0x14f
    [ 247.031281] vfs_write+0xa2/0xdf
    [ 247.032670] ksys_write+0x6b/0xb3
    [ 247.032673] do_syscall_64+0x56/0x82
    [ 247.034053] entry_SYSCALL_64_after_hwframe+0x44/0xa9
    [ 247.034059] RIP: 0033:0x7f69f39e9008
    [ 247.036330] Code: Bad RIP value.
    [ 247.036331] RSP: 002b:00007ffdd8116498 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
    [ 247.037613] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f69f39e9008
    [ 247.039714] RDX: 0000000000000002 RSI: 000055cde92a0ab0 RDI: 0000000000000001
    [ 247.039715] RBP: 000055cde92a0ab0 R08: 000000000000000a R09: 00007f69f3a79e80
    [ 247.039716] R10: 000000000000000a R11: 0000000000000246 R12: 00007f69f3abb780
    [ 247.039717] R13: 0000000000000002 R14: 00007f69f3ab6740 R15: 0000000000000002

    Link: https://lore.kernel.org/r/20200720025435.812030-1-ming.lei@redhat.com
    Cc: linux-block@vger.kernel.org
    Cc: Christoph Hellwig
    Reviewed-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Ming Lei
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

30 Jun, 2020

1 commit

  • blk-mq budget is abstract from scsi's device queue depth, and it is
    always per-request-queue instead of hctx.

    It can be quite absurd to get a budget from one hctx, then dequeue a
    request from scheduler queue, and this request may not belong to this
    hctx, at least for bfq and deadline.

    So fix the mess and always pass request queue to get/put budget
    callback.

    Signed-off-by: Ming Lei
    Tested-by: Baolin Wang
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Douglas Anderson
    Reviewed-by: Sagi Grimberg
    Cc: Sagi Grimberg
    Cc: Baolin Wang
    Cc: Christoph Hellwig
    Cc: Douglas Anderson
    Signed-off-by: Jens Axboe

    Ming Lei
     

24 Jun, 2020

1 commit

  • Move the call to blk_should_fake_timeout out of blk_mq_complete_request
    and into the drivers, skipping call sites that are obvious error
    handlers, and remove the now superflous blk_mq_force_complete_rq helper.
    This ensures we don't keep injecting errors into completions that just
    terminate the Linux request after the hardware has been reset or the
    command has been aborted.

    Reviewed-by: Daniel Wagner
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

20 Jun, 2020

2 commits

  • Delete trailing whitespace, multiple blank lines, and make switch/case be
    at the same indentation.

    Link: https://lore.kernel.org/r/20200619154117.10262-3-huobean@gmail.com
    Signed-off-by: Bean Huo
    Signed-off-by: Martin K. Petersen

    Bean Huo
     
  • After commit f664a3cc17b7 ("scsi: kill off the legacy IO path"),
    scsi_sdb_cache is not used anymore. Remove it.

    Link: https://lore.kernel.org/r/20200619154117.10262-2-huobean@gmail.com
    Reviewed-by: Bart Van Assche
    Signed-off-by: Bean Huo
    Signed-off-by: Martin K. Petersen

    Bean Huo
     

06 Jun, 2020

1 commit

  • Pull SCSI updates from James Bottomley:
    :This series consists of the usual driver updates (qla2xxx, ufs, zfcp,
    target, scsi_debug, lpfc, qedi, qedf, hisi_sas, mpt3sas) plus a host
    of other minor updates.

    There are no major core changes in this series apart from a
    refactoring in scsi_lib.c"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (207 commits)
    scsi: ufs: ti-j721e-ufs: Fix unwinding of pm_runtime changes
    scsi: cxgb3i: Fix some leaks in init_act_open()
    scsi: ibmvscsi: Make some functions static
    scsi: iscsi: Fix deadlock on recovery path during GFP_IO reclaim
    scsi: ufs: Fix WriteBooster flush during runtime suspend
    scsi: ufs: Fix index of attributes query for WriteBooster feature
    scsi: ufs: Allow WriteBooster on UFS 2.2 devices
    scsi: ufs: Remove unnecessary memset for dev_info
    scsi: ufs-qcom: Fix scheduling while atomic issue
    scsi: mpt3sas: Fix reply queue count in non RDPQ mode
    scsi: lpfc: Fix lpfc_nodelist leak when processing unsolicited event
    scsi: target: tcmu: Fix a use after free in tcmu_check_expired_queue_cmd()
    scsi: vhost: Notify TCM about the maximum sg entries supported per command
    scsi: qla2xxx: Remove return value from qla_nvme_ls()
    scsi: qla2xxx: Remove an unused function
    scsi: iscsi: Register sysfs for iscsi workqueue
    scsi: scsi_debug: Parser tables and code interaction
    scsi: core: Refactor scsi_mq_setup_tags function
    scsi: core: Fix incorrect usage of shost_for_each_device
    scsi: qla2xxx: Fix endianness annotations in source files
    ...

    Linus Torvalds
     

03 Jun, 2020

1 commit

  • Pull block updates from Jens Axboe:
    "Core block changes that have been queued up for this release:

    - Remove dead blk-throttle and blk-wbt code (Guoqing)

    - Include pid in blktrace note traces (Jan)

    - Don't spew I/O errors on wouldblock termination (me)

    - Zone append addition (Johannes, Keith, Damien)

    - IO accounting improvements (Konstantin, Christoph)

    - blk-mq hardware map update improvements (Ming)

    - Scheduler dispatch improvement (Salman)

    - Inline block encryption support (Satya)

    - Request map fixes and improvements (Weiping)

    - blk-iocost tweaks (Tejun)

    - Fix for timeout failing with error injection (Keith)

    - Queue re-run fixes (Douglas)

    - CPU hotplug improvements (Christoph)

    - Queue entry/exit improvements (Christoph)

    - Move DMA drain handling to the few drivers that use it (Christoph)

    - Partition handling cleanups (Christoph)"

    * tag 'for-5.8/block-2020-06-01' of git://git.kernel.dk/linux-block: (127 commits)
    block: mark bio_wouldblock_error() bio with BIO_QUIET
    blk-wbt: rename __wbt_update_limits to wbt_update_limits
    blk-wbt: remove wbt_update_limits
    blk-throttle: remove tg_drain_bios
    blk-throttle: remove blk_throtl_drain
    null_blk: force complete for timeout request
    blk-mq: drain I/O when all CPUs in a hctx are offline
    blk-mq: add blk_mq_all_tag_iter
    blk-mq: open code __blk_mq_alloc_request in blk_mq_alloc_request_hctx
    blk-mq: use BLK_MQ_NO_TAG in more places
    blk-mq: rename BLK_MQ_TAG_FAIL to BLK_MQ_NO_TAG
    blk-mq: move more request initialization to blk_mq_rq_ctx_init
    blk-mq: simplify the blk_mq_get_request calling convention
    blk-mq: remove the bio argument to ->prepare_request
    nvme: force complete cancelled requests
    blk-mq: blk-mq: provide forced completion method
    block: fix a warning when blkdev.h is included for !CONFIG_BLOCK builds
    block: blk-crypto-fallback: remove redundant initialization of variable err
    block: reduce part_stat_lock() scope
    block: use __this_cpu_add() instead of access by smp_processor_id()
    ...

    Linus Torvalds
     

20 May, 2020

2 commits

  • shost->tag_set is used too many times, introduce temporary parameter
    tag_set instead of &shost->tag_set.

    Link: https://lore.kernel.org/r/20200518074732.39679-1-yebin10@huawei.com
    Reviewed-by: Bart Van Assche
    Signed-off-by: Ye Bin
    Signed-off-by: Martin K. Petersen

    Ye Bin
     
  • shost_for_each_device(sdev, shost) \
    for ((sdev) = __scsi_iterate_devices((shost), NULL); \
    (sdev); \
    (sdev) = __scsi_iterate_devices((shost), (sdev)))

    When terminating shost_for_each_device() iteration with break or return,
    scsi_device_put() should be used to prevent stale scsi device references
    from being left behind.

    Link: https://lore.kernel.org/r/20200518074420.39275-1-yebin10@huawei.com
    Reviewed-by: Bart Van Assche
    Signed-off-by: Ye Bin
    Signed-off-by: Martin K. Petersen

    Ye Bin
     

13 May, 2020

1 commit

  • Define REQ_OP_ZONE_APPEND to append-write sectors to a zone of a zoned
    block device. This is a no-merge write operation.

    A zone append write BIO must:
    * Target a zoned block device
    * Have a sector position indicating the start sector of the target zone
    * The target zone must be a sequential write zone
    * The BIO must not cross a zone boundary
    * The BIO size must not be split to ensure that a single range of LBAs
    is written with a single command.

    Implement these checks in generic_make_request_checks() using the
    helper function blk_check_zone_append(). To avoid write append BIO
    splitting, introduce the new max_zone_append_sectors queue limit
    attribute and ensure that a BIO size is always lower than this limit.
    Export this new limit through sysfs and check these limits in bio_full().

    Also when a LLDD can't dispatch a request to a specific zone, it
    will return BLK_STS_ZONE_RESOURCE indicating this request needs to
    be delayed, e.g. because the zone it will be dispatched to is still
    write-locked. If this happens set the request aside in a local list
    to continue trying dispatching requests such as READ requests or a
    WRITE/ZONE_APPEND requests targetting other zones. This way we can
    still keep a high queue depth without starving other requests even if
    one request can't be served due to zone write-locking.

    Finally, make sure that the bio sector position indicates the actual
    write position as indicated by the device on completion.

    Signed-off-by: Keith Busch
    [ jth: added zone-append specific add_page and merge_page helpers ]
    Signed-off-by: Johannes Thumshirn
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Reviewed-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Keith Busch
     

30 Apr, 2020

1 commit

  • In case scsi_setup_fs_cmnd() fails we're not freeing the sgtables allocated
    by scsi_init_io(), thus we leak the allocated memory.

    Free the sgtables allocated by scsi_init_io() in case scsi_setup_fs_cmnd()
    fails.

    Technically scsi_setup_scsi_cmnd() does not suffer from this problem as it
    can only fail if scsi_init_io() fails, so it does not have sgtables
    allocated. But to maintain symmetry and as a measure of defensive
    programming, free the sgtables on scsi_setup_scsi_cmnd() failure as well.
    scsi_mq_free_sgtables() has safeguards against double-freeing of memory so
    this is safe to do.

    While we're at it, rename scsi_mq_free_sgtables() to scsi_free_sgtables().

    Link: https://bugzilla.kernel.org/show_bug.cgi?id=205595
    Link: https://lore.kernel.org/r/20200428104605.8143-2-johannes.thumshirn@wdc.com
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Daniel Wagner
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Johannes Thumshirn
    Signed-off-by: Martin K. Petersen

    Johannes Thumshirn
     

28 Apr, 2020

1 commit

  • Despite of functions being documented, they are not in the kernel-doc
    specification, and could not be included in kernel documentation. Change
    the style of functions comments to be compliant to the kernel-doc style.
    When the function comments are outdated, update then.

    [mkp: a few edits]

    Link: https://lore.kernel.org/r/20200419050148.33371-1-andrealmeid@collabora.com
    Signed-off-by: André Almeida
    Signed-off-by: Martin K. Petersen

    André Almeida
     

25 Apr, 2020

1 commit

  • scsi_host_block() calls scsi_internal_device_block() for each scsi_device and
    scsi_internal_device_block() calls blk_mq_quiesce_queue() for each LUN.

    Since synchronize_rcu() is called from blk_mq_quiesce_queue(), this can cause
    substantial slowdowns on systems with many LUNs.

    Use scsi_internal_device_block_nowait() to implement scsi_host_block() so it
    is sufficient to run synchronize_rcu() once. This is safe since SCSI does not
    set the BLK_MQ_F_BLOCKING flag.

    [mkp: commit desc and comment tweaks]

    Link: https://lore.kernel.org/r/20200423020713.332743-1-ming.lei@redhat.com
    Cc: Steffen Maier
    Cc: Bart Van Assche
    Cc: Christoph Hellwig
    Cc: Dexuan Cui
    Cc: Hannes Reinecke
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Hannes Reinecke
    Signed-off-by: Ming Lei
    Signed-off-by: Martin K. Petersen

    Ming Lei
     

23 Apr, 2020

3 commits