1. 24 2月, 2016 7 次提交
  2. 12 2月, 2016 1 次提交
    • J
      scsi: fix soft lockup in scsi_remove_target() on module removal · 90a88d6e
      James Bottomley 提交于
      This softlockup is currently happening:
      
      [  444.088002] NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [kworker/1:1:29]
      [  444.088002] Modules linked in: lpfc(-) qla2x00tgt(O) qla2xxx_scst(O) scst_vdisk(O) scsi_transport_fc libcrc32c scst(O) dlm configfs nfsd lockd grace nfs_acl auth_rpcgss sunrpc ed
      d snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device dm_mod iTCO_wdt snd_hda_codec_realtek snd_hda_codec_generic gpio_ich iTCO_vendor_support ppdev snd_hda_intel snd_hda_codec snd_hda
      _core snd_hwdep tg3 snd_pcm snd_timer libphy lpc_ich parport_pc ptp acpi_cpufreq snd pps_core fjes parport i2c_i801 ehci_pci tpm_tis tpm sr_mod cdrom soundcore floppy hwmon sg 8250_
      fintek pcspkr i915 drm_kms_helper uhci_hcd ehci_hcd drm fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit usbcore button video usb_common fan ata_generic ata_piix libata th
      ermal
      [  444.088002] CPU: 1 PID: 29 Comm: kworker/1:1 Tainted: G           O    4.4.0-rc5-2.g1e923a3-default #1
      [  444.088002] Hardware name: FUJITSU SIEMENS ESPRIMO E           /D2164-A1, BIOS 5.00 R1.10.2164.A1               05/08/2006
      [  444.088002] Workqueue: fc_wq_4 fc_rport_final_delete [scsi_transport_fc]
      [  444.088002] task: f6266ec0 ti: f6268000 task.ti: f6268000
      [  444.088002] EIP: 0060:[<c07e7044>] EFLAGS: 00000286 CPU: 1
      [  444.088002] EIP is at _raw_spin_unlock_irqrestore+0x14/0x20
      [  444.088002] EAX: 00000286 EBX: f20d3800 ECX: 00000002 EDX: 00000286
      [  444.088002] ESI: f50ba800 EDI: f2146848 EBP: f6269ec8 ESP: f6269ec8
      [  444.088002]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      [  444.088002] CR0: 8005003b CR2: 08f96600 CR3: 363ae000 CR4: 000006d0
      [  444.088002] Stack:
      [  444.088002]  f6269eec c066b0f7 00000286 f2146848 f50ba808 f50ba800 f50ba800 f2146a90
      [  444.088002]  f2146848 f6269f08 f8f0a4ed f3141000 f2146800 f2146a90 f619fa00 00000040
      [  444.088002]  f6269f40 c026cb25 00000001 166c6392 00000061 f6757140 f6136340 00000004
      [  444.088002] Call Trace:
      [  444.088002]  [<c066b0f7>] scsi_remove_target+0x167/0x1c0
      [  444.088002]  [<f8f0a4ed>] fc_rport_final_delete+0x9d/0x1e0 [scsi_transport_fc]
      [  444.088002]  [<c026cb25>] process_one_work+0x155/0x3e0
      [  444.088002]  [<c026cde7>] worker_thread+0x37/0x490
      [  444.088002]  [<c027214b>] kthread+0x9b/0xb0
      [  444.088002]  [<c07e72c1>] ret_from_kernel_thread+0x21/0x40
      
      What appears to be happening is that something has pinned the target
      so it can't go into STARGET_DEL via final release and the loop in
      scsi_remove_target spins endlessly until that happens.
      
      The fix for this soft lockup is to not keep looping over a device that
      we've called remove on but which hasn't gone into DEL state.  This
      patch will retain a simplistic memory of the last target and not keep
      looping over it.
      Reported-by: NSebastian Herbszt <herbszt@gmx.de>
      Tested-by: NSebastian Herbszt <herbszt@gmx.de>
      Fixes: 40998193
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      90a88d6e
  3. 11 2月, 2016 1 次提交
  4. 10 2月, 2016 1 次提交
  5. 07 2月, 2016 2 次提交
  6. 05 2月, 2016 3 次提交
    • M
      block/sd: Return -EREMOTEIO when WRITE SAME and DISCARD are disabled · 0fb5b1fb
      Martin K. Petersen 提交于
      When a storage device rejects a WRITE SAME command we will disable write
      same functionality for the device and return -EREMOTEIO to the block
      layer. -EREMOTEIO will in turn prevent DM from retrying the I/O and/or
      failing the path.
      
      Yiwen Jiang discovered a small race where WRITE SAME requests issued
      simultaneously would cause -EIO to be returned. This happened because
      any requests being prepared after WRITE SAME had been disabled for the
      device caused us to return BLKPREP_KILL. The latter caused the block
      layer to return -EIO upon completion.
      
      To overcome this we introduce BLKPREP_INVALID which indicates that this
      is an invalid request for the device. blk_peek_request() is modified to
      return -EREMOTEIO in that case.
      Reported-by: NYiwen Jiang <jiangyiwen@huawei.com>
      Suggested-by: NMike Snitzer <snitzer@redhat.com>
      Reviewed-by: NHannes Reinicke <hare@suse.de>
      Reviewed-by: NEwan Milne <emilne@redhat.com>
      Reviewed-by: NYiwen Jiang <jiangyiwen@huawei.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      0fb5b1fb
    • M
      SCSI: Add Marvell Console to VPD blacklist · 82c43310
      Mika Westerberg 提交于
      I have a Marvell 88SE9230 SATA Controller that has some sort of
      integrated console SCSI device attached to one of the ports.
      
        ata14: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
        ata14.00: ATAPI: MARVELL VIRTUALL, 1.09, max UDMA/66
        ata14.00: configured for UDMA/66
        scsi 13:0:0:0: Processor         Marvell  Console 1.01 PQ: 0 ANSI: 5
      
      Sending it VPD INQUIRY command seem to always fail with following error:
      
        ata14.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
        ata14.00: irq_stat 0x40000001
        ata14.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 2 dma 16640 in
                  Inquiry 12 01 00 00 ff 00res 00/00:00:00:00:00/00:00:00:00:00/00 Emask 0x3 (HSM violation)
        ata14: hard resetting link
      
      This has been minor annoyance (only error printed on dmesg) until commit
      09e2b0b1 ("scsi: rescan VPD attributes") added call to scsi_attach_vpd()
      in scsi_rescan_device(). The commit causes the system to splat out
      following errors continuously without ever reaching the UI:
      
        ata14.00: configured for UDMA/66
        ata14: EH complete
        ata14.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
        ata14.00: irq_stat 0x40000001
        ata14.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 6 dma 16640 in
                  Inquiry 12 01 00 00 ff 00res 00/00:00:00:00:00/00:00:00:00:00/00 Emask 0x3 (HSM violation)
        ata14: hard resetting link
        ata14: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
        ata14.00: configured for UDMA/66
        ata14: EH complete
        ata14.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6
        ata14.00: irq_stat 0x40000001
        ata14.00: cmd a0/01:00:00:00:01/00:00:00:00:00/a0 tag 7 dma 16640 in
                  Inquiry 12 01 00 00 ff 00res 00/00:00:00:00:00/00:00:00:00:00/00 Emask 0x3 (HSM violation)
      
      Without in-depth understanding of SCSI layer and the Marvell controller,
      I suspect this happens because when the link goes down (because of an
      error) we schedule scsi_rescan_device() which again fails to read VPD
      data... ad infinitum.
      
      Since VPD data cannot be read from the device anyway we prevent the SCSI
      layer from even trying by blacklisting the device. This gets away the
      error and the system starts up normally.
      
      [mkp: Widened the match to all revisions of this device]
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reported-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Reported-by: NAlexander Duyck <alexander.duyck@gmail.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      82c43310
    • H
      scsi_dh_rdac: always retry MODE SELECT on command lock violation · d2d06d4f
      Hannes Reinecke 提交于
      If MODE SELECT returns with sense '05/91/36' (command lock violation)
      it should always be retried without counting the number of retries.
      During an HBA upgrade or similar circumstances one might see a flood
      of MODE SELECT command from various HBAs, which will easily trigger
      the sense code and exceed the retry count.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d2d06d4f
  7. 04 2月, 2016 1 次提交
    • K
      drivers/scsi/sg.c: mark VMA as VM_IO to prevent migration · 461c7fa1
      Kirill A. Shutemov 提交于
      Reduced testcase:
      
          #include <fcntl.h>
          #include <unistd.h>
          #include <sys/mman.h>
          #include <numaif.h>
      
          #define SIZE 0x2000
      
          int main()
          {
              int fd;
              void *p;
      
              fd = open("/dev/sg0", O_RDWR);
              p = mmap(NULL, SIZE, PROT_EXEC, MAP_PRIVATE | MAP_LOCKED, fd, 0);
              mbind(p, SIZE, 0, NULL, 0, MPOL_MF_MOVE);
              return 0;
          }
      
      We shouldn't try to migrate pages in sg VMA as we don't have a way to
      update Sg_scatter_hold::pages accordingly from mm core.
      
      Let's mark the VMA as VM_IO to indicate to mm core that the VMA is not
      migratable.
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Reported-by: NDmitry Vyukov <dvyukov@google.com>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Cc: Doug Gilbert <dgilbert@interlog.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
      Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
      Cc: Shiraz Hashim <shashim@codeaurora.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: syzkaller <syzkaller@googlegroups.com>
      Cc: Kostya Serebryany <kcc@google.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      461c7fa1
  8. 30 1月, 2016 2 次提交
  9. 29 1月, 2016 2 次提交
  10. 27 1月, 2016 3 次提交
  11. 21 1月, 2016 3 次提交
  12. 20 1月, 2016 1 次提交
    • A
      scsi: qla2xxxx: avoid type mismatch in comparison · fab683eb
      Arnd Bergmann 提交于
      A recent bug fix added code that does
      
              bool logged_out = (status & 0xFFFF);
              if (logged_out == CTIO_PORT_LOGGED_OUT)
      		...
      
      This looks wrong because we are comparing a boolean with an
      integer constant, ang gcc warns about it accordingly:
      
      drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_do_ctio_completion':
      drivers/scsi/qla2xxx/qla_target.c:3587:20: warning: comparison of constant '41' with boolean expression is always false [-Wbool-compare]
              (logged_out == CTIO_PORT_LOGGED_OUT) ?
      
      The correct fix is presumably to make that variable an 'int'.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 71cdc079 ("qla2xxx: Delete session if initiator is gone from FW")
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      fab683eb
  13. 09 1月, 2016 8 次提交
  14. 08 1月, 2016 5 次提交
    • I
      ipr: Fix out-of-bounds null overwrite · d63c7dd5
      Insu Yun 提交于
      Return value of snprintf is not bound by size value, 2nd argument.
      (https://www.kernel.org/doc/htmldocs/kernel-api/API-snprintf.html).
      Return value is number of printed chars, can be larger than 2nd
      argument.  Therefore, it can write null byte out of bounds ofbuffer.
      Since snprintf puts null, it does not need to put additional null byte.
      Signed-off-by: NInsu Yun <wuninsu@gmail.com>
      Reviewed-by: NShane Seymour <shane.seymour@hpe.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d63c7dd5
    • M
      scsi: add Synology to 1024 sector blacklist · 9055082f
      Mike Christie 提交于
      Another iscsi target that cannot handle large IOs, but does not tell us
      a limit.
      
      The Synology iSCSI targets report:
      
      Block limits VPD page (SBC):
        Write same no zero (WSNZ): 0
        Maximum compare and write length: 0 blocks
        Optimal transfer length granularity: 0 blocks
        Maximum transfer length: 0 blocks
        Optimal transfer length: 0 blocks
        Maximum prefetch length: 0 blocks
        Maximum unmap LBA count: 0
        Maximum unmap block descriptor count: 0
        Optimal unmap granularity: 0
        Unmap granularity alignment valid: 0
        Unmap granularity alignment: 0
        Maximum write same length: 0x0 blocks
      
      and the size of the command it can handle seems to depend on how much
      memory it can allocate at the time. This results in IO errors when
      handling large IOs. This patch just has us use the old 1024 default
      sectors for this target by adding it to the scsi blacklist. We do not
      have good contacs with this vendors, so I have not been able to try and
      fix on their side.
      
      I have posted this a long while back, but it was not merged. This
      version just fixes it up for merge/patch failures in the original
      version.
      Reported-by: NAncoron Luciferis <ancoron.luciferis@googlemail.com>
      Reported-by: NMichael Meyers <steltek@tcnnet.com>
      Signed-off-by: NMike Christie <mchristi@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Cc: <stable@vger.kernel.org> # 4.1+
      9055082f
    • D
      qla2xxx: Check for online flag instead of active reset when transmitting responses · 3bb67df5
      Dilip Kumar Uppugandla 提交于
      Driver has following initialization sequence for Target mode
      
      1. Driver initialization starts
      
      2. ISP Abort is scheduled when the target is enabled.
      
      qla2xxx [0000:04:00.0]-4807:25: ISP abort scheduled
      qla2xxx [0000:04:00.0]-00af:25: Performing ISP error recovery - ha=ffff880caa9e0000.
      
      3. DPC thread starts the ISP Abort
      
      4. While DPC is resetting the chip and initializing the firmware, we get
         async events from the firmware about P2P mode, LOOP UP and PORT UPDATE.
      
      5. PRLI from a initiator is delivered to us followed by a PLOGI and then a
         SCSI command which creates a session.
      
      6. If the SCSI command is a WRITE in this case, we issue XFR RDY and it
         gets dropped as can be seen with messages RESET-XFR because ISP Abort
         is still active
      
      qla2xxx [0000:04:00.0]-e902:25: RESET-XFR active/old-count/new-count = 1/1/1.
      
      7. If the SCSI command is a READ, we issue RESPONSE and they get dropped
         as well because Abort is still active.
      
      qla2xxx [0000:04:00.0]-e901:25: RESET-RSP active/old-count/new-count = 1/1/1
      
      8. Now eventually, ISP Abort finishes clearing the DPC flags.
      
      qla2xxx [0000:04:00.0]-8822:25: qla2x00_abort_isp succeeded.
      qla2xxx [0000:04:00.0]-4808:25: ISP abort end.
      
      9. Since we dropped SCSI commands silently (without any responses sent
         to the initiator) initiator waits for a SCSI timeout (which is 60
         seconds in our case), Sends an ABTS which fails since there
         no se_cmd found for the tag that ABTS is referencing as the
         commands were cleaned up in Step 6 and 7.
      
      10. Initiator send an IO after the ABTS which succeed fine.
      
      To fix the above case, the following changes have been made:
        - To prevent target from dropping commands silently, use the online flag
          instead to check for an active chip reset. Once the port is online during
          a chip reset phase, we are good to process the commands.
        - Clean up qla2x00_restart_isp to not set the online flag and process ATIO
          as it is unnecessary. During a chip reset, interrupts are enabled only
          after setting the online flag to 1, so ATIO's won't be missed and hence
          no need to process ATIO's after setting the online flag.
      Signed-off-by: NDilip Kumar Uppugandla <dilip@purestorage.com>
      Signed-off-by: NHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      3bb67df5
    • Q
      qla2xxx: Set all queues to 4k · e7b42e33
      Quinn Tran 提交于
      set ATIO/Request/Response Queues and Default number
      of outstanding command to 4k.
      Signed-off-by: NQuinn Tran <quinn.tran@qlogic.com>
      Signed-off-by: NHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e7b42e33
    • Q
      481ce733