1. 03 Aug, 2018 1 commit
  2. 02 Aug, 2018 3 commits
    • Johannes Thumshirn's avatar
      scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO · 1550ec45
      Johannes Thumshirn authored
      When receiving a LOGO request we forget to clear the FC_RP_STARTED flag
      before starting the rport delete routine.
      
      As the started flag was not cleared, we're not deleting the rport but
      waiting for a restart and thus are keeping the reference count of the rdata
      object at 1.
      
      This leads to the following kmemleak report:
      unreferenced object 0xffff88006542aa00 (size 512):
        comm "kworker/0:2", pid 24, jiffies 4294899222 (age 226.880s)
        hex dump (first 32 bytes):
          68 96 fe 65 00 88 ff ff 00 00 00 00 00 00 00 00  h..e............
          01 00 00 00 08 00 00 00 02 c5 45 24 ac b8 00 10  ..........E$....
        backtrace:
          [<(____ptrval____)>] fcoe_ctlr_vn_add.isra.5+0x7f/0x770 [libfcoe]
          [<(____ptrval____)>] fcoe_ctlr_vn_recv+0x12af/0x27f0 [libfcoe]
          [<(____ptrval____)>] fcoe_ctlr_recv_work+0xd01/0x32f0 [libfcoe]
          [<(____ptrval____)>] process_one_work+0x7ff/0x1420
          [<(____ptrval____)>] worker_thread+0x87/0xef0
          [<(____ptrval____)>] kthread+0x2db/0x390
          [<(____ptrval____)>] ret_from_fork+0x35/0x40
          [<(____ptrval____)>] 0xffffffffffffffff
      Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reported-by: default avatarard <ard@kwaak.net>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      1550ec45
    • Johannes Thumshirn's avatar
      scsi: fcoe: drop frames in ELS LOGO error path · 63d0e3df
      Johannes Thumshirn authored
      Drop the frames in the ELS LOGO error path instead of just returning an
      error.
      
      This fixes the following kmemleak report:
      unreferenced object 0xffff880064cb1000 (size 424):
        comm "kworker/0:2", pid 24, jiffies 4294904293 (age 68.504s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<(____ptrval____)>] _fc_frame_alloc+0x2c/0x180 [libfc]
          [<(____ptrval____)>] fc_lport_enter_logo+0x106/0x360 [libfc]
          [<(____ptrval____)>] fc_fabric_logoff+0x8c/0xc0 [libfc]
          [<(____ptrval____)>] fcoe_if_destroy+0x79/0x3b0 [fcoe]
          [<(____ptrval____)>] fcoe_destroy_work+0xd2/0x170 [fcoe]
          [<(____ptrval____)>] process_one_work+0x7ff/0x1420
          [<(____ptrval____)>] worker_thread+0x87/0xef0
          [<(____ptrval____)>] kthread+0x2db/0x390
          [<(____ptrval____)>] ret_from_fork+0x35/0x40
          [<(____ptrval____)>] 0xffffffffffffffff
      
      which can be triggered by issuing
      echo eth0 > /sys/bus/fcoe/ctlr_destroy
      Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      63d0e3df
    • Johannes Thumshirn's avatar
      scsi: fcoe: fix use-after-free in fcoe_ctlr_els_send · 2d7d4fd3
      Johannes Thumshirn authored
      KASAN reports a use-after-free in fcoe_ctlr_els_send() when we're sending a
      LOGO and have FIP debugging enabled. This is because we're first freeing
      the skb and then printing the frame's DID. But the DID is a member of the
      FC frame header which in turn is the skb's payload.
      
      Exchange the debug print and kfree_skb() calls so we're not touching the
      freed data.
      Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      2d7d4fd3
  3. 31 Jul, 2018 2 commits
  4. 20 Jul, 2018 5 commits
  5. 13 Jul, 2018 4 commits
  6. 11 Jul, 2018 8 commits
    • Cédric Le Goater's avatar
      scsi: cxlflash: fix assignment of the backend operations · 943e59fe
      Cédric Le Goater authored
      commit cd43c221 ("scsi: cxlflash: Isolate external module
      dependencies") introduced the use of ifdefs to avoid compilation errors
      when one of the possible backend driver, CXL or OCXL, is not compiled.
      
      Unfortunately, the wrong defines are used and the backend ops are never
      assigned, leading to a kernel crash in any case when the cxlflash module is
      loaded.
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      943e59fe
    • Manish Rangankar's avatar
      scsi: qedi: Send driver state to MFW · a3440d0d
      Manish Rangankar authored
      In case of iSCSI offload BFS environment, MFW requires to mark virtual
      link based upon qedi load status.
      Signed-off-by: default avatarManish Rangankar <manish.rangankar@qlogic.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      a3440d0d
    • Saurav Kashyap's avatar
      scsi: qedf: Send the driver state to MFW · 6ac17475
      Saurav Kashyap authored
      Need to notify firmware when driver is loaded and unloaded.
      Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@cavium.com>
      Signed-off-by: default avatarChad Dupuis <chad.dupuis@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6ac17475
    • Don Brace's avatar
      scsi: hpsa: correct enclosure sas address · 01d0e789
      Don Brace authored
      The original complaint was the lsscsi -t showed the same SAS address of the
      two enclosures (SEP devices). In fact the SAS address was being set to the
      Enclosure Logical Identifier (ELI).
      Reviewed-by: default avatarScott Teel <scott.teel@microsemi.com>
      Reviewed-by: default avatarKevin Barnett <kevin.barnett@microsemi.com>
      Signed-off-by: default avatarDon Brace <don.brace@microsemi.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      01d0e789
    • Damien Le Moal's avatar
      scsi: sd_zbc: Fix variable type and bogus comment · f13cff6c
      Damien Le Moal authored
      Fix the description of sd_zbc_check_zone_size() to correctly explain that
      the returned value is a number of device blocks, not bytes.  Additionally,
      the 32 bits "ret" variable used in this function may truncate the 64 bits
      zone_blocks variable value upon return. To fix this, change "ret" type to
      s64.
      
      Fixes: ccce20fc ("sd_zbc: Avoid that resetting a zone fails sporadically")
      Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Cc: Bart Van Assche <bart.vanassche@wdc.com>
      Cc: stable@kernel.org
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Reviewed-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      f13cff6c
    • Chuck Anderson's avatar
      scsi: qla2xxx: Fix NULL pointer dereference for fcport search · 36eb8ff6
      Chuck Anderson authored
      Crash dump shows following instructions
      
      crash> bt
      PID: 0      TASK: ffffffffbe412480  CPU: 0   COMMAND: "swapper/0"
       #0 [ffff891ee0003868] machine_kexec at ffffffffbd063ef1
       #1 [ffff891ee00038c8] __crash_kexec at ffffffffbd12b6f2
       #2 [ffff891ee0003998] crash_kexec at ffffffffbd12c84c
       #3 [ffff891ee00039b8] oops_end at ffffffffbd030f0a
       #4 [ffff891ee00039e0] no_context at ffffffffbd074643
       #5 [ffff891ee0003a40] __bad_area_nosemaphore at ffffffffbd07496e
       #6 [ffff891ee0003a90] bad_area_nosemaphore at ffffffffbd074a64
       #7 [ffff891ee0003aa0] __do_page_fault at ffffffffbd074b0a
       #8 [ffff891ee0003b18] do_page_fault at ffffffffbd074fc8
       #9 [ffff891ee0003b50] page_fault at ffffffffbda01925
          [exception RIP: qlt_schedule_sess_for_deletion+15]
          RIP: ffffffffc02e526f  RSP: ffff891ee0003c08  RFLAGS: 00010046
          RAX: 0000000000000000  RBX: 0000000000000000  RCX: ffffffffc0307847
          RDX: 00000000000020e6  RSI: ffff891edbc377c8  RDI: 0000000000000000
          RBP: ffff891ee0003c18   R8: ffffffffc02f0b20   R9: 0000000000000250
          R10: 0000000000000258  R11: 000000000000b780  R12: ffff891ed9b43000
          R13: 00000000000000f0  R14: 0000000000000006  R15: ffff891edbc377c8
          ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
       #10 [ffff891ee0003c20] qla2x00_fcport_event_handler at ffffffffc02853d3 [qla2xxx]
       #11 [ffff891ee0003cf0] __dta_qla24xx_async_gnl_sp_done_333 at ffffffffc0285a1d [qla2xxx]
       #12 [ffff891ee0003de8] qla24xx_process_response_queue at ffffffffc02a2eb5 [qla2xxx]
       #13 [ffff891ee0003e88] qla24xx_msix_rsp_q at ffffffffc02a5403 [qla2xxx]
       #14 [ffff891ee0003ec0] __handle_irq_event_percpu at ffffffffbd0f4c59
       #15 [ffff891ee0003f10] handle_irq_event_percpu at ffffffffbd0f4e02
       #16 [ffff891ee0003f40] handle_irq_event at ffffffffbd0f4e90
       #17 [ffff891ee0003f68] handle_edge_irq at ffffffffbd0f8984
       #18 [ffff891ee0003f88] handle_irq at ffffffffbd0305d5
       #19 [ffff891ee0003fb8] do_IRQ at ffffffffbda02a18
       --- <IRQ stack> ---
       #20 [ffffffffbe403d30] ret_from_intr at ffffffffbda0094e
          [exception RIP: unknown or invalid address]
          RIP: 000000000000001f  RSP: 0000000000000000  RFLAGS: fff3b8c2091ebb3f
          RAX: ffffbba5a0000200  RBX: 0000be8cdfa8f9fa  RCX: 0000000000000018
          RDX: 0000000000000101  RSI: 000000000000015d  RDI: 0000000000000193
          RBP: 0000000000000083   R8: ffffffffbe403e38   R9: 0000000000000002
          R10: 0000000000000000  R11: ffffffffbe56b820  R12: ffff891ee001cf00
          R13: ffffffffbd11c0a4  R14: ffffffffbe403d60  R15: 0000000000000001
          ORIG_RAX: ffff891ee0022ac0  CS: 0000  SS: ffffffffffffffb9
       bt: WARNING: possibly bogus exception frame
       #21 [ffffffffbe403dd8] cpuidle_enter_state at ffffffffbd67c6fd
       #22 [ffffffffbe403e40] cpuidle_enter at ffffffffbd67c907
       #23 [ffffffffbe403e50] call_cpuidle at ffffffffbd0d98f3
       #24 [ffffffffbe403e60] do_idle at ffffffffbd0d9b42
       #25 [ffffffffbe403e98] cpu_startup_entry at ffffffffbd0d9da3
       #26 [ffffffffbe403ec0] rest_init at ffffffffbd81d4aa
       #27 [ffffffffbe403ed0] start_kernel at ffffffffbe67d2ca
       #28 [ffffffffbe403f28] x86_64_start_reservations at ffffffffbe67c675
       #29 [ffffffffbe403f38] x86_64_start_kernel at ffffffffbe67c6eb
       #30 [ffffffffbe403f50] secondary_startup_64 at ffffffffbd0000d5
      
      Fixes: 040036bb ("scsi: qla2xxx: Delay loop id allocation at login")
      Cc: <stable@vger.kernel.org> # v4.17+
      Signed-off-by: default avatarChuck Anderson <chuck.anderson@oracle.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      36eb8ff6
    • himanshu.madhani@cavium.com's avatar
      scsi: qla2xxx: Fix kernel crash due to late workqueue allocation · d48cc67c
      himanshu.madhani@cavium.com authored
      This patch fixes crash for FCoE adapter. Once driver initialization is
      complete, firmware will start posting Asynchronous Event, However driver
      has not yet allocated workqueue to process and queue up work.  This delay
      of allocating workqueue results into NULL pointer access.
      
      The following stack trace is seen:
      
      [   24.577259] BUG: unable to handle kernel NULL pointer dereference at 0000000000000102
      [   24.623133] PGD 0 P4D 0
      [   24.636760] Oops: 0000 [#1] SMP NOPTI
      [   24.656942] Modules linked in: i2c_algo_bit drm_kms_helper sr_mod(+) syscopyarea sysfillrect sysimgblt cdrom fb_sys_fops ata_generic ttm pata_acpi sd_mod ahci pata_atiixp sfc(+) qla2xxx(+) libahci drm qla4xxx(+) nvme_fc hpsa mdio libiscsi qlcnic(+) nvme_fabrics scsi_transport_sas serio_raw mtd crc32c_intel libata nvme_core i2c_core scsi_transport_iscsi tg3 scsi_transport_fc bnx2 iscsi_boot_sysfs dm_multipath dm_mirror dm_region_hash dm_log dm_mod
      [   24.887449] CPU: 0 PID: 177 Comm: kworker/0:3 Not tainted 4.17.0-rc6 #1
      [   24.925119] Hardware name: HP ProLiant DL385 G7, BIOS A18 08/15/2012
      [   24.962106] Workqueue: events work_for_cpu_fn
      [   24.987098] RIP: 0010:__queue_work+0x1f/0x3a0
      [   25.011672] RSP: 0018:ffff992642ceba10 EFLAGS: 00010082
      [   25.042116] RAX: 0000000000000082 RBX: 0000000000000082 RCX: 0000000000000000
      [   25.083293] RDX: ffff8cf9abc6d7d0 RSI: 0000000000000000 RDI: 0000000000002000
      [   25.123094] RBP: 0000000000000000 R08: 0000000000025a40 R09: ffff8cf9aade2880
      [   25.164087] R10: 0000000000000000 R11: ffff992642ceb6f0 R12: ffff8cf9abc6d7d0
      [   25.202280] R13: 0000000000002000 R14: ffff8cf9abc6d7b8 R15: 0000000000002000
      [   25.242050] FS:  0000000000000000(0000) f9b5c00000(0000) knlGS:0000000000000000
      [   25.977565] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   26.010457] CR2: 0000000000000102 CR3: 000000030760a000 CR4: 00000000000406f0
      [   26.051048] Call Trace:
      [   26.063572]  ? __switch_to_asm+0x34/0x70
      [   26.086079]  queue_work_on+0x24/0x40
      [   26.107090]  qla2x00_post_work+0x81/0xb0 [qla2xxx]
      [   26.133356]  qla2x00_async_event+0x1ad/0x1a20 [qla2xxx]
      [   26.164075]  ? lock_timer_base+0x67/0x80
      [   26.186420]  ? try_to_del_timer_sync+0x4d/0x80
      [   26.212284]  ? del_timer_sync+0x35/0x40
      [   26.234080]  ? schedule_timeout+0x165/0x2f0
      [   26.259575]  qla82xx_poll+0x13e/0x180 [qla2xxx]
      [   26.285740]  qla2x00_mailbox_command+0x74b/0xf50 [qla2xxx]
      [   26.319040]  qla82xx_set_driver_version+0x13b/0x1c0 [qla2xxx]
      [   26.352108]  ? qla2x00_init_rings+0x206/0x3f0 [qla2xxx]
      [   26.381733]  qla2x00_initialize_adapter+0x35c/0x7f0 [qla2xxx]
      [   26.413240]  qla2x00_probe_one+0x1479/0x2390 [qla2xxx]
      [   26.442055]  local_pci_probe+0x3f/0xa0
      [   26.463108]  work_for_cpu_fn+0x10/0x20
      [   26.483295]  process_one_work+0x152/0x350
      [   26.505730]  worker_thread+0x1cf/0x3e0
      [   26.527090]  kthread+0xf5/0x130
      [   26.545085]  ? max_active_store+0x80/0x80
      [   26.568085]  ? kthread_bind+0x10/0x10
      [   26.589533]  ret_from_fork+0x22/0x40
      [   26.610192] Code: 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 57 41 89 ff 41 56 41 55 41 89 fd 41 54 49 89 d4 55 48 89 f5 53 48 83 ec 0 86 02 01 00 00 01 0f 85 80 02 00 00 49 c7 c6 c0 ec 01 00 41
      [   27.308540] RIP: __queue_work+0x1f/0x3a0 RSP: ffff992642ceba10
      [   27.341591] CR2: 0000000000000102
      [   27.360208] ---[ end trace 01b7b7ae2c005cf3 ]---
      
      Cc: <stable@vger.kernel.org> # v4.17+
      Fixes: 9b3e0f4d ("scsi: qla2xxx: Move work element processing out of DPC thread"
      Reported-by: default avatarLi Wang <liwang@redhat.com>
      Tested-by: default avatarLi Wang <liwang@redhat.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      d48cc67c
    • Quinn Tran's avatar
      scsi: qla2xxx: Fix inconsistent DMA mem alloc/free · b5f3bc39
      Quinn Tran authored
      GPNFT command allocates 2 buffer for switch query. On completion, the same
      buffers were freed using different size, instead of using original size at
      the time of allocation.
      
      This patch saves the size of the request and response buffers and uses that
      to free them.
      
      Following stack trace can be seen when using debug kernel
      
      dump_stack+0x19/0x1b
      __warn+0xd8/0x100
      warn_slowpath_fmt+0x5f/0x80
      check_unmap+0xfb/0xa20
      debug_dma_free_coherent+0x110/0x160
      qla24xx_sp_unmap+0x131/0x1e0 [qla2xxx]
      qla24xx_async_gnnft_done+0xb6/0x550 [qla2xxx]
      qla2x00_do_work+0x1ec/0x9f0 [qla2xxx]
      
      Cc: <stable@vger.kernel.org> # v4.17+
      Fixes: 33b28357 ("scsi: qla2xxx: Fix Async GPN_FT for FCP and FC-NVMe scan")
      Reported-by: default avatarEwan D. Milne <emilne@redhat.com>
      Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
      Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: default avatarHimanshu Madhani <hmadhani@redhat.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      b5f3bc39
  7. 26 Jun, 2018 2 commits
  8. 20 Jun, 2018 1 commit
  9. 19 Jun, 2018 4 commits
    • Luis Henriques's avatar
      scsi: scsi_debug: Fix memory leak on module unload · 52ab9768
      Luis Henriques authored
      Since commit 80c49563 ("scsi: scsi_debug: implement IMMED bit") there
      are long delays in F_SYNC_DELAY and F_SSU_DELAY.  This can cause a memory
      leak in schedule_resp(), which can be invoked while unloading the
      scsi_debug module: free_all_queued() had already freed all sd_dp and
      schedule_resp will alloc a new one, which will never get freed.  Here's the
      kmemleak report while running xfstests generic/350:
      
      unreferenced object 0xffff88007d752b00 (size 128):
        comm "rmmod", pid 26940, jiffies 4295816945 (age 7.588s)
        hex dump (first 32 bytes):
          00 2b 75 7d 00 88 ff ff 00 00 00 00 00 00 00 00  .+u}............
          00 00 00 00 00 00 00 00 8e 31 a2 34 5f 03 00 00  .........1.4_...
        backtrace:
          [<000000002abd83d0>] 0xffffffffa000705e
          [<000000004c063fda>] scsi_dispatch_cmd+0xc7/0x1a0
          [<000000000c119a00>] scsi_request_fn+0x251/0x550
          [<000000009de0c736>] __blk_run_queue+0x3f/0x60
          [<000000001c4453c8>] blk_execute_rq_nowait+0x98/0xd0
          [<00000000d17ec79f>] blk_execute_rq+0x3a/0x50
          [<00000000a7654b6e>] scsi_execute+0x113/0x250
          [<00000000fd78f7cd>] sd_sync_cache+0x95/0x160
          [<0000000024dacb14>] sd_shutdown+0x9b/0xd0
          [<00000000e9101710>] sd_remove+0x5f/0xb0
          [<00000000c43f0d63>] device_release_driver_internal+0x13c/0x1f0
          [<00000000e8ad57b6>] bus_remove_device+0xe9/0x160
          [<00000000713a7b8a>] device_del+0x120/0x320
          [<00000000e5db670c>] __scsi_remove_device+0x115/0x150
          [<00000000eccbef30>] scsi_forget_host+0x20/0x60
          [<00000000cd5a0738>] scsi_remove_host+0x6d/0x120
      
      Cc: stable@vger.kernel.org # v4.17+
      Signed-off-by: default avatarLuis Henriques <lhenriques@suse.com>
      Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      52ab9768
    • Mikhail Malygin's avatar
      scsi: qla2xxx: Spinlock recursion in qla_target · 49d7bd36
      Mikhail Malygin authored
      The patch reverts changes done in qlt_schedule_sess_for_deletion() to
      avoid spinlock recursion sess->vha->work_lock should be used instead
      of ha->tgt.sess_lock, that can be locked in callers: qlt_reset() or
      qlt_handle_login()
      
      [mkp: roll in build warning reported by sfr]
      
      Fixes: 1c6cacf4 ("scsi: qla2xxx: Fixup locking for session deletion")
      Cc: <stable@vger.kernel.org> #v4.17
      Signed-off-by: default avatarMikhail Malygin <m.malygin@yadro.com>
      Reported-by: default avatarMikhail Malygin <m.malygin@yadro.com>
      Tested-by: default avatarMikhail Malygin <m.malygin@yadro.com>
      Acked-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      49d7bd36
    • Arnd Bergmann's avatar
      scsi: ipr: Eliminate duplicate barriers · f2233a33
      Arnd Bergmann authored
      Driver does both wmb() and writel(). The latter already has a barrier
      on some architectures like arm64. This ends up with CPU observing two
      barriers back to back before executing the register write.
      
      Drivers should generally assume that the barrier implied by writel() is
      sufficient for ordering DMA. Remove the extraneous wmb() before it.
      
      [mkp: Squashed Arnd's and Sinan's patches]
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarSinan Kaya <okaya@codeaurora.org>
      Acked-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      f2233a33
    • bstroesser@ts.fujitsu.com's avatar
      scsi: target: tcmu: add read length support · 6c3796d1
      bstroesser@ts.fujitsu.com authored
      Generally target core and TCMUser seem to work fine for tape devices and
      media changers.  But there is at least one situation where TCMUser is not
      able to support sequential access device emulation correctly.
      
      The situation is when an initiator sends a SCSI READ CDB with a length that
      is greater than the length of the tape block to read. We can distinguish
      two subcases:
      
      A) The initiator sent the READ CDB with the SILI bit being set.
      
         In this case the sequential access device has to transfer the data from
         the tape block (only the length of the tape block) and transmit a good
         status.  The current interface between TCMUser and the userspace does
         not support reduction of the read data size by the userspace program.
      
         The patch below fixes this subcase by allowing the userspace program to
         specify a reduced data size in read direction.
      
      B) The initiator sent the READ CDB with the SILI bit not being set.
      
         In this case the sequential access device has to transfer the data from
         the tape block as in A), but additionally has to transmit CHECK
         CONDITION with the ILI bit set and NO SENSE in the sensebytes. The
         information field in the sensebytes must contain the residual count.
      
         With the below patch a user space program can specify the real read data
         length and appropriate sensebytes.  TCMUser then uses the se_cmd flag
         SCF_TREAT_READ_AS_NORMAL, to force target core to transmit the real data
         size and the sensebytes.  Note: the flag SCF_TREAT_READ_AS_NORMAL is
         introduced by Lee Duncan's patch "[PATCH v4] target: transport should
         handle st FM/EOM/ILI reads" from Tue, 15 May 2018 18:25:24 -0700.
      Signed-off-by: default avatarBodo Stroesser <bstroesser@ts.fujitsu.com>
      Acked-by: default avatarMike Christie <mchristi@redhat.com>
      Reviewed-by: default avatarLee Duncan <lduncan@suse.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      6c3796d1
  10. 16 Jun, 2018 8 commits
    • Linus Torvalds's avatar
      Linux 4.18-rc1 · ce397d21
      Linus Torvalds authored
      ce397d21
    • Linus Torvalds's avatar
      Merge tag 'for-linus-20180616' of git://git.kernel.dk/linux-block · 265c5596
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A collection of fixes that should go into -rc1. This contains:
      
         - bsg_open vs bsg_unregister race fix (Anatoliy)
      
         - NVMe pull request from Christoph, with fixes for regressions in
           this window, FC connect/reconnect path code unification, and a
           trace point addition.
      
         - timeout fix (Christoph)
      
         - remove a few unused functions (Christoph)
      
         - blk-mq tag_set reinit fix (Roman)"
      
      * tag 'for-linus-20180616' of git://git.kernel.dk/linux-block:
        bsg: fix race of bsg_open and bsg_unregister
        block: remov blk_queue_invalidate_tags
        nvme-fabrics: fix and refine state checks in __nvmf_check_ready
        nvme-fabrics: handle the admin-only case properly in nvmf_check_ready
        nvme-fabrics: refactor queue ready check
        blk-mq: remove blk_mq_tagset_iter
        nvme: remove nvme_reinit_tagset
        nvme-fc: fix nulling of queue data on reconnect
        nvme-fc: remove reinit_request routine
        blk-mq: don't time out requests again that are in the timeout handler
        nvme-fc: change controllers first connect to use reconnect path
        nvme: don't rely on the changed namespace list log
        nvmet: free smart-log buffer after use
        nvme-rdma: fix error flow during mapping request data
        nvme: add bio remapping tracepoint
        nvme: fix NULL pointer dereference in nvme_init_subsystem
        blk-mq: reinit q->tag_set_list entry only after grace period
      265c5596
    • Linus Torvalds's avatar
      Merge tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental · 5e7b9212
      Linus Torvalds authored
      Pull documentation fixes from Mauro Carvalho Chehab:
       "This solves a series of broken links for files under Documentation,
        and improves a script meant to detect such broken links (see
        scripts/documentation-file-ref-check).
      
        The changes on this series are:
      
         - can.rst: fix a footnote reference;
      
         - crypto_engine.rst: Fix two parsing warnings;
      
         - Fix a lot of broken references to Documentation/*;
      
         - improve the scripts/documentation-file-ref-check script, in order
           to help detecting/fixing broken references, preventing
           false-positives.
      
        After this patch series, only 33 broken references to doc files are
        detected by scripts/documentation-file-ref-check"
      
      * tag 'docs-broken-links' of git://linuxtv.org/mchehab/experimental: (26 commits)
        fix a series of Documentation/ broken file name references
        Documentation: rstFlatTable.py: fix a broken reference
        ABI: sysfs-devices-system-cpu: remove a broken reference
        devicetree: fix a series of wrong file references
        devicetree: fix name of pinctrl-bindings.txt
        devicetree: fix some bindings file names
        MAINTAINERS: fix location of DT npcm files
        MAINTAINERS: fix location of some display DT bindings
        kernel-parameters.txt: fix pointers to sound parameters
        bindings: nvmem/zii: Fix location of nvmem.txt
        docs: Fix more broken references
        scripts/documentation-file-ref-check: check tools/*/Documentation
        scripts/documentation-file-ref-check: get rid of false-positives
        scripts/documentation-file-ref-check: hint: dash or underline
        scripts/documentation-file-ref-check: add a fix logic for DT
        scripts/documentation-file-ref-check: accept more wildcards at filenames
        scripts/documentation-file-ref-check: fix help message
        media: max2175: fix location of driver's companion documentation
        media: v4l: fix broken video4linux docs locations
        media: dvb: point to the location of the old README.dvb-usb file
        ...
      5e7b9212
    • Linus Torvalds's avatar
      Merge tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · dbb2816f
      Linus Torvalds authored
      Pull fsnotify updates from Jan Kara:
       "fsnotify cleanups unifying handling of different watch types.
      
        This is the shortened fsnotify series from Amir with the last five
        patches pulled out. Amir has modified those patches to not change
        struct inode but obviously it's too late for those to go into this
        merge window"
      
      * tag 'fsnotify_for_v4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fsnotify: add fsnotify_add_inode_mark() wrappers
        fanotify: generalize fanotify_should_send_event()
        fsnotify: generalize send_to_group()
        fsnotify: generalize iteration of marks by object type
        fsnotify: introduce marks iteration helpers
        fsnotify: remove redundant arguments to handle_event()
        fsnotify: use type id to identify connector object type
      dbb2816f
    • Linus Torvalds's avatar
      Merge tag 'fbdev-v4.18' of git://github.com/bzolnier/linux · 644f2639
      Linus Torvalds authored
      Pull fbdev updates from Bartlomiej Zolnierkiewicz:
       "There is nothing really major here, few small fixes, some cleanups and
        dead drivers removal:
      
         - mark omapfb drivers as orphans in MAINTAINERS file (Tomi Valkeinen)
      
         - add missing module license tags to omap/omapfb driver (Arnd
           Bergmann)
      
         - add missing GPIOLIB dependendy to omap2/omapfb driver (Arnd
           Bergmann)
      
         - convert savagefb, aty128fb & radeonfb drivers to use msleep & co.
           (Jia-Ju Bai)
      
         - allow COMPILE_TEST build for viafb driver (media part was reviewed
           by media subsystem Maintainer)
      
         - remove unused MERAM support from sh_mobile_lcdcfb and shmob-drm
           drivers (drm parts were acked by shmob-drm driver Maintainer)
      
         - remove unused auo_k190xfb drivers
      
         - misc cleanups (Souptick Joarder, Wolfram Sang, Markus Elfring, Andy
           Shevchenko, Colin Ian King)"
      
      * tag 'fbdev-v4.18' of git://github.com/bzolnier/linux: (26 commits)
        fb_omap2: add gpiolib dependency
        video/omap: add module license tags
        MAINTAINERS: make omapfb orphan
        video: fbdev: pxafb: match_string() conversion fixup
        video: fbdev: nvidia: fix spelling mistake: "scaleing" -> "scaling"
        video: fbdev: fix spelling mistake: "frambuffer" -> "framebuffer"
        video: fbdev: pxafb: Convert to use match_string() helper
        video: fbdev: via: allow COMPILE_TEST build
        video: fbdev: remove unused sh_mobile_meram driver
        drm: shmobile: remove unused MERAM support
        video: fbdev: sh_mobile_lcdcfb: remove unused MERAM support
        video: fbdev: remove unused auo_k190xfb drivers
        video: omap: Improve a size determination in omapfb_do_probe()
        video: sm501fb: Improve a size determination in sm501fb_probe()
        video: fbdev-MMP: Improve a size determination in path_init()
        video: fbdev-MMP: Delete an error message for a failed memory allocation in two functions
        video: auo_k190x: Delete an error message for a failed memory allocation in auok190x_common_probe()
        video: sh_mobile_lcdcfb: Delete an error message for a failed memory allocation in two functions
        video: sh_mobile_meram: Delete an error message for a failed memory allocation in sh_mobile_meram_probe()
        video: fbdev: sh_mobile_meram: Drop SUPERH platform dependency
        ...
      644f2639
    • Linus Torvalds's avatar
      Merge branch 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 35773c93
      Linus Torvalds authored
      Pull AFS updates from Al Viro:
       "Assorted AFS stuff - ended up in vfs.git since most of that consists
        of David's AFS-related followups to Christoph's procfs series"
      
      * 'afs-proc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        afs: Optimise callback breaking by not repeating volume lookup
        afs: Display manually added cells in dynamic root mount
        afs: Enable IPv6 DNS lookups
        afs: Show all of a server's addresses in /proc/fs/afs/servers
        afs: Handle CONFIG_PROC_FS=n
        proc: Make inline name size calculation automatic
        afs: Implement network namespacing
        afs: Mark afs_net::ws_cell as __rcu and set using rcu functions
        afs: Fix a Sparse warning in xdr_decode_AFSFetchStatus()
        proc: Add a way to make network proc files writable
        afs: Rearrange fs/afs/proc.c to remove remaining predeclarations.
        afs: Rearrange fs/afs/proc.c to move the show routines up
        afs: Rearrange fs/afs/proc.c by moving fops and open functions down
        afs: Move /proc management functions to the end of the file
      35773c93
    • Linus Torvalds's avatar
      Merge branch 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 29d6849d
      Linus Torvalds authored
      Pull compat updates from Al Viro:
       "Some biarch patches - getting rid of assorted (mis)uses of
        compat_alloc_user_space().
      
        Not much in that area this cycle..."
      
      * 'work.compat' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        orangefs: simplify compat ioctl handling
        signalfd: lift sigmask copyin and size checks to callers of do_signalfd4()
        vmsplice(): lift importing iovec into vmsplice(2) and compat counterpart
      29d6849d
    • Linus Torvalds's avatar
      Merge branch 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · a5b729ea
      Linus Torvalds authored
      Pull aio fixes from Al Viro:
       "Assorted AIO followups and fixes"
      
      * 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        eventpoll: switch to ->poll_mask
        aio: only return events requested in poll_mask() for IOCB_CMD_POLL
        eventfd: only return events requested in poll_mask()
        aio: mark __aio_sigset::sigmask const
      a5b729ea
  11. 15 Jun, 2018 2 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 9215310c
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Various netfilter fixlets from Pablo and the netfilter team.
      
       2) Fix regression in IPVS caused by lack of PMTU exceptions on local
          routes in ipv6, from Julian Anastasov.
      
       3) Check pskb_trim_rcsum for failure in DSA, from Zhouyang Jia.
      
       4) Don't crash on poll in TLS, from Daniel Borkmann.
      
       5) Revert SO_REUSE{ADDR,PORT} change, it regresses various things
          including Avahi mDNS. From Bart Van Assche.
      
       6) Missing of_node_put in qcom/emac driver, from Yue Haibing.
      
       7) We lack checking of the TCP checking in one special case during SYN
          receive, from Frank van der Linden.
      
       8) Fix module init error paths of mac80211 hwsim, from Johannes Berg.
      
       9) Handle 802.1ad properly in stmmac driver, from Elad Nachman.
      
      10) Must grab HW caps before doing quirk checks in stmmac driver, from
          Jose Abreu.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (81 commits)
        net: stmmac: Run HWIF Quirks after getting HW caps
        neighbour: skip NTF_EXT_LEARNED entries during forced gc
        net: cxgb3: add error handling for sysfs_create_group
        tls: fix waitall behavior in tls_sw_recvmsg
        tls: fix use-after-free in tls_push_record
        l2tp: filter out non-PPP sessions in pppol2tp_tunnel_ioctl()
        l2tp: reject creation of non-PPP sessions on L2TPv2 tunnels
        mlxsw: spectrum_switchdev: Fix port_vlan refcounting
        mlxsw: spectrum_router: Align with new route replace logic
        mlxsw: spectrum_router: Allow appending to dev-only routes
        ipv6: Only emit append events for appended routes
        stmmac: added support for 802.1ad vlan stripping
        cfg80211: fix rcu in cfg80211_unregister_wdev
        mac80211: Move up init of TXQs
        mac80211_hwsim: fix module init error paths
        cfg80211: initialize sinfo in cfg80211_get_station
        nl80211: fix some kernel doc tag mistakes
        hv_netvsc: Fix the variable sizes in ipsecv2 and rsc offload
        rds: avoid unenecessary cong_update in loop transport
        l2tp: clean up stale tunnel or session in pppol2tp_connect's error path
        ...
      9215310c
    • Linus Torvalds's avatar
      Merge tag 'modules-for-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · de7f01c2
      Linus Torvalds authored
      Pull module updates from Jessica Yu:
       "Minor code cleanup and also allow sig_enforce param to be shown in
        sysfs with CONFIG_MODULE_SIG_FORCE"
      
      * tag 'modules-for-v4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
        module: Allow to always show the status of modsign
        module: Do not access sig_enforce directly
      de7f01c2