1. 12 4月, 2016 20 次提交
  2. 05 4月, 2016 2 次提交
    • H
      scsi: Do not attach VPD to devices that don't support it · 5ddfe085
      Hannes Reinecke 提交于
      The patch "scsi: rescan VPD attributes" introduced a regression in which
      devices that don't support VPD were being scanned for VPD attributes
      anyway.  This could cause issues for some devices and should be avoided
      so the check for scsi_level has been moved out of scsi_add_lun and into
      scsi_attach_vpd so that all callers will not scan VPD for devices that
      don't support it.
      
      [mkp: Merge fix]
      
      Fixes: 09e2b0b1 ("scsi: rescan VPD attributes")
      Cc: <stable@vger.kernel.org> #v4.5+
      Suggested-by: NAlexander Duyck <aduyck@mirantis.com>
      Signed-off-by: NHannes Reinecke <hare@suse.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      5ddfe085
    • K
      mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros · 09cbfeaf
      Kirill A. Shutemov 提交于
      PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
      ago with promise that one day it will be possible to implement page
      cache with bigger chunks than PAGE_SIZE.
      
      This promise never materialized.  And unlikely will.
      
      We have many places where PAGE_CACHE_SIZE assumed to be equal to
      PAGE_SIZE.  And it's constant source of confusion on whether
      PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
      especially on the border between fs and mm.
      
      Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
      breakage to be doable.
      
      Let's stop pretending that pages in page cache are special.  They are
      not.
      
      The changes are pretty straight-forward:
      
       - <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
      
       - PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
      
       - page_cache_get() -> get_page();
      
       - page_cache_release() -> put_page();
      
      This patch contains automated changes generated with coccinelle using
      script below.  For some reason, coccinelle doesn't patch header files.
      I've called spatch for them manually.
      
      The only adjustment after coccinelle is revert of changes to
      PAGE_CAHCE_ALIGN definition: we are going to drop it later.
      
      There are few places in the code where coccinelle didn't reach.  I'll
      fix them manually in a separate patch.  Comments and documentation also
      will be addressed with the separate patch.
      
      virtual patch
      
      @@
      expression E;
      @@
      - E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      expression E;
      @@
      - E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
      + E
      
      @@
      @@
      - PAGE_CACHE_SHIFT
      + PAGE_SHIFT
      
      @@
      @@
      - PAGE_CACHE_SIZE
      + PAGE_SIZE
      
      @@
      @@
      - PAGE_CACHE_MASK
      + PAGE_MASK
      
      @@
      expression E;
      @@
      - PAGE_CACHE_ALIGN(E)
      + PAGE_ALIGN(E)
      
      @@
      expression E;
      @@
      - page_cache_get(E)
      + get_page(E)
      
      @@
      expression E;
      @@
      - page_cache_release(E)
      + put_page(E)
      Signed-off-by: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      09cbfeaf
  3. 01 4月, 2016 1 次提交
  4. 30 3月, 2016 2 次提交
    • B
      scsi_dh_alua: Fix a recently introduced deadlock · 38c31599
      Bart Van Assche 提交于
      While retesting the SRP initiator I ran the command "rmmod mlx4_ib"
      while I/O was in progress. That command triggers SCSI device removal
      indirectly. Avoid that this action triggers the following deadlock:
      
      =================================
      [ INFO: inconsistent lock state ]
      4.6.0-rc0-dbg+ #2 Tainted: G           O
      ---------------------------------
      inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
      multipathd/484 [HC0[0]:SC0[0]:HE1:SE1] takes:
       (&(&pg->lock)->rlock){+.?...}, at: [<ffffffffa04f50a2>] alua_bus_detach+0x52/0xa0 [scsi_dh_alua]
      {IN-SOFTIRQ-W} state was registered at:
        [<ffffffff810a64a9>] __lock_acquire+0x7e9/0x1ad0
        [<ffffffff810a7fd0>] lock_acquire+0x60/0x80
        [<ffffffff8159910e>] _raw_spin_lock_irqsave+0x3e/0x60
        [<ffffffffa04f5131>] alua_rtpg_queue+0x41/0x1d0 [scsi_dh_alua]
        [<ffffffffa04f5531>] alua_check+0xe1/0x220 [scsi_dh_alua]
        [<ffffffffa04f5709>] alua_check_sense+0x99/0xb0 [scsi_dh_alua]
        [<ffffffff813f0d01>] scsi_check_sense+0x71/0x3f0
        [<ffffffff813f2f8b>] scsi_decide_disposition+0x18b/0x1d0
        [<ffffffff813f6e52>] scsi_softirq_done+0x52/0x140
        [<ffffffff812a26f2>] blk_done_softirq+0x52/0x90
        [<ffffffff8105bc1f>] __do_softirq+0x10f/0x230
        [<ffffffff8105bec8>] irq_exit+0xa8/0xb0
        [<ffffffff8101a675>] do_IRQ+0x65/0x110
        [<ffffffff8159a2c9>] ret_from_intr+0x0/0x19
        [<ffffffff811732f1>] kmem_cache_alloc+0x151/0x190
        [<ffffffff8118e534>] create_object+0x34/0x2d0
        [<ffffffff8158eaa6>] kmemleak_alloc_percpu+0x56/0xd0
        [<ffffffff8113ab0d>] pcpu_alloc+0x38d/0x660
        [<ffffffff8113aded>] __alloc_percpu_gfp+0xd/0x10
        [<ffffffff812e56a5>] __percpu_counter_init+0x55/0xb0
        [<ffffffff812b4989>] blkg_alloc+0x79/0x230
        [<ffffffff812b6756>] blkcg_init_queue+0x26/0x1d0
        [<ffffffff81297eed>] blk_alloc_queue_node+0x27d/0x2e0
        [<ffffffffa017766c>] dm_create+0x20c/0x570 [dm_mod]
        [<ffffffffa017e356>] dev_create+0x56/0x2c0 [dm_mod]
        [<ffffffffa017dcae>] ctl_ioctl+0x26e/0x520 [dm_mod]
        [<ffffffffa017df6e>] dm_ctl_ioctl+0xe/0x20 [dm_mod]
        [<ffffffff811aa8ee>] do_vfs_ioctl+0x8e/0x660
        [<ffffffff811aaefc>] SyS_ioctl+0x3c/0x70
        [<ffffffff81599929>] entry_SYSCALL_64_fastpath+0x1c/0xac
      irq event stamp: 4290931
      hardirqs last  enabled at (4290931): [ 1662.892772]
      [<ffffffff81599341>] _raw_spin_unlock_irqrestore+0x31/0x50
      hardirqs last disabled at (4290930): [<ffffffff815990e7>] _raw_spin_lock_irqsave+0x17/0x60
      softirqs last  enabled at (4290774): [<ffffffff8105bcdb>] __do_softirq+0x1cb/0x230
      softirqs last disabled at (4289831): [<ffffffff8105bec8>] irq_exit+0xa8/0xb0
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(&(&pg->lock)->rlock);
        <Interrupt>
          lock(&(&pg->lock)->rlock);
      
       *** DEADLOCK ***
      
      2 locks held by multipathd/484:
       #0:  (&bdev->bd_mutex){+.+.+.}, at: [<ffffffff811d1cc3>] __blkdev_put+0x33/0x360
       #1:  (sd_ref_mutex){+.+...}, at: [<ffffffff81400afc>] scsi_disk_put+0x1c/0x40
      
      stack backtrace:
      CPU: 6 PID: 484 Comm: multipathd Tainted: G           O    4.6.0-rc0-dbg+ #2
      Call Trace:
       [<ffffffff812bd115>] dump_stack+0x67/0x92
       [<ffffffff810a5175>] print_usage_bug+0x215/0x240
       [<ffffffff810a56ea>] mark_lock+0x54a/0x610
       [<ffffffff810a6505>] __lock_acquire+0x845/0x1ad0
       [<ffffffff810a7fd0>] lock_acquire+0x60/0x80
       [<ffffffff81598f23>] _raw_spin_lock+0x33/0x50
       [<ffffffffa04f50a2>] alua_bus_detach+0x52/0xa0 [scsi_dh_alua]
       [<ffffffff813ff6f7>] scsi_dh_release_device+0x17/0x50
       [<ffffffff813fb8da>] scsi_device_dev_release_usercontext+0x2a/0x120
       [<ffffffff810701f0>] execute_in_process_context+0x80/0x90
       [<ffffffff813fb8a7>] scsi_device_dev_release+0x17/0x20
       [<ffffffff813c8cfd>] device_release+0x2d/0x90
       [<ffffffff812bfa8a>] kobject_release+0x7a/0x190
       [<ffffffff812bf946>] kobject_put+0x26/0x50
       [<ffffffff813c8ee2>] put_device+0x12/0x20
       [<ffffffff813edc86>] scsi_device_put+0x26/0x30
       [<ffffffff81400b0d>] scsi_disk_put+0x2d/0x40
       [<ffffffff81400b68>] sd_release+0x48/0xb0
       [<ffffffff811d1f2e>] __blkdev_put+0x29e/0x360
       [<ffffffff811d24b9>] blkdev_put+0x49/0x170
       [<ffffffff811d2600>] blkdev_close+0x20/0x30
       [<ffffffff81198f48>] __fput+0xe8/0x1f0
       [<ffffffff81199089>] ____fput+0x9/0x10
       [<ffffffff81075d9e>] task_work_run+0x6e/0xa0
       [<ffffffff81001119>] exit_to_usermode_loop+0xa9/0xb0
       [<ffffffff81001590>] syscall_return_slowpath+0xb0/0xc0
       [<ffffffff815999b7>] entry_SYSCALL_64_fastpath+0xaa/0xac
      
      Fixes: cb0a168c (scsi_dh_alua: update 'access_state' field)
      Cc: Hannes Reinecke <hare@suse.de>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NLaurence Oberman <loberman@redhat.com>
      Reviewed-by: NHannes Reinicke <hare@suse.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NEwan Milne <emilne@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      38c31599
    • B
      scsi: Declare local symbols static · d78540da
      Bart Van Assche 提交于
      Avoid that building with W=1 causes gcc to report warnings about symbols
      that have not been declared.
      
      Cc: Hannes Reinecke <hare@suse.de>
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NHannes Reinicke <hare@suse.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NEwan Milne <emilne@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      d78540da
  5. 29 3月, 2016 2 次提交
    • M
      cxlflash: Move to exponential back-off when cmd_room is not available · ea765431
      Manoj N. Kumar 提交于
      While profiling the cxlflash_queuecommand() path under a heavy load it
      was found that number of retries to find cmd_room was fairly high.
      
      There are two problems with the current back-off:
      a) It starts with a udelay of 0
      b) It backs-off linearly
      
      Tried several approaches (a higher multiple 10*n, 100*n, as well as n^2,
      2^n) and found that the exponential back-off(2^n) approach had the least
      overall cost. Cost as being defined as overall time spent waiting.
      
      The fix is to change the linear back-off to an exponential back-off.
      This solution also takes care of the problem with the initial
      delay (starts with 1 usec).
      Signed-off-by: NManoj N. Kumar <manoj@linux.vnet.ibm.com>
      Acked-by: NMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      ea765431
    • M
      cxlflash: Fix regression issue with re-ordering patch · 9526f360
      Manoj N. Kumar 提交于
      While running 'sg_reset -H' back to back the following exception was seen:
      
      [  735.115695] Faulting instruction address: 0xd0000000098c0864
      cpu 0x0: Vector: 300 (Data Access) at [c000000ffffafa80]
          pc: d0000000098c0864: cxlflash_async_err_irq+0x84/0x5c0 [cxlflash]
          lr: c00000000013aed0: handle_irq_event_percpu+0xa0/0x310
          sp: c000000ffffafd00
         msr: 9000000000009033
         dar: 2010000
       dsisr: 40000000
        current = 0xc000000001510880
        paca    = 0xc00000000fb80000   softe: 0        irq_happened: 0x01
          pid   = 0, comm = swapper/0
      
      Linux version 4.5.0-491-26f710d+
      
      enter ? for help
      [c000000ffffafe10] c00000000013aed0 handle_irq_event_percpu+0xa0/0x310
      [c000000ffffafed0] c00000000013b1a8 handle_irq_event+0x68/0xc0
      [c000000ffffaff00] c0000000001404ec handle_fasteoi_irq+0xec/0x2a0
      [c000000ffffaff30] c00000000013a084 generic_handle_irq+0x54/0x80
      [c000000ffffaff60] c000000000011130 __do_irq+0x80/0x1d0
      [c000000ffffaff90] c000000000024d40 call_do_irq+0x14/0x24
      [c000000001573a20] c000000000011318 do_IRQ+0x98/0x140
      [c000000001573a70] c000000000002594 hardware_interrupt_common+0x114/0x180
      
      This exception is being hit because the async_err interrupt path performs
      an MMIO to read the interrupt status register. The MMIO region in this
      case is not available.
      
      Commit 6ded8b3c ("cxlflash: Unmap problem state area before detaching
      master context") re-ordered the sequence in which term_mc() and stop_afu()
      are called. This introduces a window for interrupts to come in with the
      problem space area unmapped, that did not exist previously.
      
      The fix is to separate the disabling of all AFU interrupts to a distinct
      function, term_intr() so that it is the first thing that is done in the
      tear down process.
      
      To keep the initialization process symmetric, separate the AFU interrupt
      setup also to a distinct function: init_intr().
      
      Fixes: 6ded8b3c ("cxlflash: Unmap problem state area before detaching master context")
      Signed-off-by: NManoj N. Kumar <manoj@linux.vnet.ibm.com>
      Acked-by: NMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NUma Krishnan <ukrishn@linux.vnet.ibm.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      9526f360
  6. 24 3月, 2016 1 次提交
    • C
      mpt3sas: Don't overreach ioc->reply_post[] during initialization · 5ec8a175
      Calvin Owens 提交于
      In _base_make_ioc_operational(), we walk ioc->reply_queue_list and pull
      a pointer out of successive elements of ioc->reply_post[] for each entry
      in that list if RDPQ is enabled.
      
      Since the code pulls the pointer for the next iteration at the bottom of
      the loop, it triggers the a KASAN dump on the final iteration:
      
          BUG: KASAN: slab-out-of-bounds in _base_make_ioc_operational+0x47b7/0x47e0 [mpt3sas] at addr ffff880754816ab0
          Read of size 8 by task modprobe/305
          <snip>
          Call Trace:
           [<ffffffff81dfc591>] dump_stack+0x4d/0x6c
           [<ffffffff814c9689>] print_trailer+0xf9/0x150
           [<ffffffff814ceda4>] object_err+0x34/0x40
           [<ffffffff814d1231>] kasan_report_error+0x221/0x530
           [<ffffffff814d1673>] __asan_report_load8_noabort+0x43/0x50
           [<ffffffffa0043637>] _base_make_ioc_operational+0x47b7/0x47e0 [mpt3sas]
           [<ffffffffa0049a51>] mpt3sas_base_attach+0x1991/0x2120 [mpt3sas]
           [<ffffffffa0053c93>] _scsih_probe+0xeb3/0x16b0 [mpt3sas]
           [<ffffffff81ebd047>] local_pci_probe+0xc7/0x170
           [<ffffffff81ebf2cf>] pci_device_probe+0x20f/0x290
           [<ffffffff820d50cd>] really_probe+0x17d/0x600
           [<ffffffff820d56a3>] __driver_attach+0x153/0x190
           [<ffffffff820cffac>] bus_for_each_dev+0x11c/0x1a0
           [<ffffffff820d421d>] driver_attach+0x3d/0x50
           [<ffffffff820d378a>] bus_add_driver+0x44a/0x5f0
           [<ffffffff820d666c>] driver_register+0x18c/0x3b0
           [<ffffffff81ebcb76>] __pci_register_driver+0x156/0x200
           [<ffffffffa00c8135>] _mpt3sas_init+0x135/0x1000 [mpt3sas]
           [<ffffffff81000423>] do_one_initcall+0x113/0x2b0
           [<ffffffff813caa5a>] do_init_module+0x1d0/0x4d8
           [<ffffffff81273909>] load_module+0x6729/0x8dc0
           [<ffffffff81276123>] SYSC_init_module+0x183/0x1a0
           [<ffffffff8127625e>] SyS_init_module+0xe/0x10
           [<ffffffff828fe7d7>] entry_SYSCALL_64_fastpath+0x12/0x6a
      
      Fix this by pulling the value at the beginning of the loop.
      Signed-off-by: NCalvin Owens <calvinowens@fb.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Reviewed-by: NJens Axboe <axboe@fb.com>
      Acked-by: NChaitra Basappa <chaitra.basappa@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      5ec8a175
  7. 22 3月, 2016 3 次提交
  8. 19 3月, 2016 6 次提交
    • H
      scsi_common: do not clobber fixed sense information · ba083116
      Hannes Reinecke 提交于
      For fixed sense the information field is 32 bits, to we need to truncate
      the information field to avoid clobbering the sense code.
      
      Fixes: a1524f22 ("libata-eh: Set 'information' field for autosense")
      Cc: <stable@vger.kernel.org> #v4.1+
      Signed-off-by: NHannes Reinecke <hare@suse.com>
      Reviewed-by: NLee Duncan <lduncan@suse.com>
      Reviewed-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NEwan D. Milne <emilne@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      ba083116
    • A
      scsi: ufs: select CONFIG_NLS · c80fa12e
      Arnd Bergmann 提交于
      A recent change to ufshcd introduced a call to utf16s_to_utf8s, a
      function that is provided by the NLS module, so we get a link error when
      that is not present:
      
      drivers/scsi/built-in.o: In function `ufshcd_read_string_desc':
      :(.text+0x124d0): undefined reference to `utf16s_to_utf8s'
      
      This adds a Kconfig 'select' statement to avoid the build error.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: b573d484 ("scsi: ufs: add support to read device and string descriptors")
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      c80fa12e
    • M
      fnic: move printk()s outside of the critical code section. · 14cee5b4
      Maurizio Lombardi 提交于
      This patch moves a printk() outside of the code section where interrupt
      are disabled. In some cases a flood of error messages may cause a kernel
      panic.  It also removes one of the printk()s because the same error
      message was printed twice.
      
      [709686.317197] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 12
      [709686.317200] CPU: 12 PID: 1963 Comm: systemd-journal Tainted: GF          O--------------   3.10.0-229.el7.x86_64 #1
      [709686.317201] Hardware name: Cisco Systems Inc UCSB-B200-M3/UCSB-B200-M3, BIOS B200M3.2.2.3.6.030620151309 03/06/2015
      [709686.317206]  ffffffff8182b2e8 00000000392722ba ffff88046fcc5c48 ffffffff81603f36
      [709686.317209]  ffff88046fcc5cc8 ffffffff815fd7da 0000000000000010 ffff88046fcc5cd8
      [709686.317211]  ffff88046fcc5c78 00000000392722ba ffff88046fcc5c88 000000000000000c
      [709686.317212] Call Trace:
      [709686.317221]  <NMI>  [<ffffffff81603f36>] dump_stack+0x19/0x1b
      [709686.317223]  [<ffffffff815fd7da>] panic+0xd8/0x1e7
      [709686.317227]  [<ffffffff8110a760>] ? watchdog_enable_all_cpus.part.2+0x40/0x40
      [709686.317229]  [<ffffffff8110a822>] watchdog_overflow_callback+0xc2/0xd0
      [709686.317233]  [<ffffffff8114c901>] __perf_event_overflow+0xa1/0x250
      [709686.317235]  [<ffffffff8114d404>] perf_event_overflow+0x14/0x20
      [709686.317239]  [<ffffffff810301fd>] intel_pmu_handle_irq+0x1fd/0x410
      [709686.317242]  [<ffffffff811908d1>] ? unmap_kernel_range_noflush+0x11/0x20
      [709686.317246]  [<ffffffff81373574>] ? ghes_copy_tofrom_phys+0x124/0x210
      [709686.317249]  [<ffffffff8160cfcb>] perf_event_nmi_handler+0x2b/0x50
      [709686.317251]  [<ffffffff8160c719>] nmi_handle.isra.0+0x69/0xb0
      [709686.317252]  [<ffffffff8160c830>] do_nmi+0xd0/0x340
      [709686.317256]  [<ffffffff8160bb71>] end_repeat_nmi+0x1e/0x2e
      [709686.317260]  [<ffffffff812e24fd>] ? memcpy+0xd/0x110
      [709686.317263]  [<ffffffff812e24fd>] ? memcpy+0xd/0x110
      [709686.317265]  [<ffffffff812e24fd>] ? memcpy+0xd/0x110
      [709686.317269]  <<EOE>>  [<ffffffff8132c297>] ? vgacon_scroll+0x2d7/0x330
      [709686.317273]  [<ffffffff813a086c>] scrup+0xfc/0x110
      [709686.317275]  [<ffffffff813a0920>] lf+0xa0/0xb0
      [709686.317278]  [<ffffffff813a1b32>] vt_console_print+0x2d2/0x420
      [709686.317283]  [<ffffffff8106f4a1>] call_console_drivers.constprop.15+0x91/0xf0
      [709686.317287]  [<ffffffff8107069f>] console_unlock+0x3bf/0x400
      [709686.317291]  [<ffffffff81070996>] vprintk_emit+0x2b6/0x530
      [709686.317294]  [<ffffffff815fd961>] printk_emit+0x44/0x5b
      [709686.317297]  [<ffffffff81070d98>] devkmsg_writev+0x158/0x1d0
      [709686.317303]  [<ffffffff811c5ef9>] do_sync_readv_writev+0x79/0xd0
      [709686.317307]  [<ffffffff811c73ee>] do_readv_writev+0xce/0x260
      [709686.317310]  [<ffffffff811c8d18>] ? __sb_start_write+0x58/0x110
      [709686.317314]  [<ffffffff811c7615>] vfs_writev+0x35/0x60
      [709686.317318]  [<ffffffff811c776c>] SyS_writev+0x5c/0xd0
      [709686.317322]  [<ffffffff81613da9>] system_call_fastpath+0x16/0x1b
      Signed-off-by: NMaurizio Lombardi <mlombard@redhat.com>
      Reviewed-by: NLaurence Oberman <loberman@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      14cee5b4
    • A
      qla2xxx: avoid maybe_uninitialized warning · bc7095a9
      Arnd Bergmann 提交于
      The qlt_check_reserve_free_req() function produces an incorrect warning
      when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:
      
      drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_check_reserve_free_req':
      drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt_in' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         ql_dbg(ql_dbg_io, vha, 0x305a,
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             "qla_target(%d): There is no room in the request ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d Req-Length=%d\n",
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             vha->vp_idx, vha->req->ring_index,
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      The problem is that gcc fails to track the state of the condition across
      an annotated branch.
      
      This slightly rearranges the code to move the second if() block
      into the first one, to avoid the warning while retaining the
      behavior of the code.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-By: NHimanshu Madhani <himanshu.madhani@qlogic.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      bc7095a9
    • A
      megaraid_sas: add missing curly braces in ioctl handler · 3deb9438
      Arnd Bergmann 提交于
      gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl
      function:
      
      drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl':
      drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
          kbuff_arr[i] = NULL;
          ^~~~~~~~~
      drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not
         if (kbuff_arr[i])
         ^~
      
      The code is actually correct, as there is no downside in clearing a NULL
      pointer again.
      
      This clarifies the code and avoids the warning by adding extra curly
      braces.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 90dc9d98 ("megaraid_sas : MFI MPT linked list corruption fix")
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Acked-by: NSumit Saxena <sumit.saxena@broadcom.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      3deb9438
    • A
      lpfc: fix misleading indentation · aeb6641f
      Arnd Bergmann 提交于
      gcc-6 complains about the indentation of the lpfc_destroy_vport_work_array()
      call in lpfc_online(), which clearly doesn't look right:
      
      drivers/scsi/lpfc/lpfc_init.c: In function 'lpfc_online':
      drivers/scsi/lpfc/lpfc_init.c:2880:3: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
         lpfc_destroy_vport_work_array(phba, vports);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/scsi/lpfc/lpfc_init.c:2863:2: note: ...this 'if' clause, but it is not
        if (vports != NULL)
        ^~
      
      Looking at the patch that introduced this code, it's clear that the
      behavior is correct and the indentation is wrong.
      
      This fixes the indentation and adds curly braces around the previous
      if() block for clarity, as that is most likely what caused the code
      to be misindented in the first place.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 549e55cd ("[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list")
      Reviewed-by: NSebastian Herbszt <herbszt@gmx.de>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Reviewed-by: NEwan D. Milne <emilne@redhat.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      aeb6641f
  9. 15 3月, 2016 3 次提交