1. 17 8月, 2015 9 次提交
  2. 15 8月, 2015 1 次提交
    • S
      zram: fix pool name truncation · 4ce321f5
      Sergey Senozhatsky 提交于
      zram_meta_alloc() constructs a pool name for zs_create_pool() call as
      
          snprintf(pool_name, sizeof(pool_name), "zram%d", device_id);
      
      However, it defines pool name buffer to be only 8 bytes long (minus
      trailing zero), which means that we can have only 1000 pool names: zram0
      -- zram999.
      
      With CONFIG_ZSMALLOC_STAT enabled an attempt to create a device zram1000
      can fail if device zram100 already exists, because snprintf() will
      truncate new pool name to zram100 and pass it debugfs_create_dir(),
      causing:
      
        debugfs dir <zram100> creation failed
        zram: Error creating memory pool
      
      ... and so on.
      
      Fix it by passing zram->disk->disk_name to zram_meta_alloc() instead of
      divice_id.  We construct zram%d name earlier and keep it as a ->disk_name,
      no need to snprintf() it again.
      Signed-off-by: NSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4ce321f5
  3. 14 8月, 2015 2 次提交
  4. 13 8月, 2015 12 次提交
    • M
      EDAC, ppc4xx: Access mci->csrows array elements properly · 5c16179b
      Michael Walle 提交于
      The commit
      
        de3910eb ("edac: change the mem allocation scheme to
      		 make Documentation/kobject.txt happy")
      
      changed the memory allocation for the csrows member. But ppc4xx_edac was
      forgotten in the patch. Fix it.
      Signed-off-by: NMichael Walle <michael@walle.cc>
      Cc: <stable@vger.kernel.org>
      Cc: linux-edac <linux-edac@vger.kernel.org>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Link: http://lkml.kernel.org/r/1437469253-8611-1-git-send-email-michael@walle.ccSigned-off-by: NBorislav Petkov <bp@suse.de>
      5c16179b
    • D
      cosa: missing error code on failure in probe() · e6d00693
      Dan Carpenter 提交于
      If register_hdlc_device() fails, the current code returns 0 but we
      should return an error code instead.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6d00693
    • J
      gianfar: remove faulty filer optimizer · 1f2b7293
      Jakub Kicinski 提交于
      Current filer rule optimization is broken in several ways:
       (1) Can perform reads/writes beyond end of allocated tables.
           (gianfar_ethtool.c:1326).
      
      (2) It breaks badly for rules with more than 2 specifiers
           (e.g. matching ip, port, tos).
      
      Example:
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.1 dst-port 1 tos 1 action 1
      Added rule with ID 254
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.2 dst-port 2 tos 2 action 9
      Added rule with ID 253
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.3 dst-port 3 tos 3 action 17
      Added rule with ID 252
      # ./filer_decode /sys/kernel/debug/gfar1/filer_raw
      00: MASK == 00000210 AND         Q:00           ctrl:00000080 prop:00000210
      01: FPR  == 00000210 AND CLE     Q:00           ctrl:00000281 prop:00000210
      02: MASK == ffffffff AND         Q:00           ctrl:00000080 prop:ffffffff
      03: DPT  == 00000003 AND         Q:00           ctrl:0000008e prop:00000003
      04: TOS  == 00000003 AND         Q:00           ctrl:0000008a prop:00000003
      05: DIA  == 0a000003 AND         Q:11           ctrl:0000448c prop:0a000003
      06: DPT  == 00000002 AND         Q:00           ctrl:0000008e prop:00000002
      07: TOS  == 00000002 AND         Q:00           ctrl:0000008a prop:00000002
      08: DIA  == 0a000002 AND         Q:09           ctrl:0000248c prop:0a000002
      09: DIA  == 0a000001 AND         Q:00           ctrl:0000008c prop:0a000001
      0a: DPT  == 00000001 AND         Q:00           ctrl:0000008e prop:00000001
      0b: TOS  == 00000001     CLE     Q:01           ctrl:0000060a prop:00000001
      ff: MASK >= 00000000             Q:00           ctrl:00000020 prop:00000000
      
      (Entire cluster gets AND-ed together).
      
       (3) We observed that the masking rules it generates do not
           play well with clustering on P2020.  Only first rule
           of the cluster would ever fire.  Given that optimizer
           relies heavily on masking this is very hard to fix.
      
      Example:
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.1 dst-port 1  action 1
      Added rule with ID 254
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.2 dst-port 2  action 9
      Added rule with ID 253
      # ethtool -N eth2 flow-type udp4 dst-ip 10.0.0.3 dst-port 3  action 17
      Added rule with ID 252
      # ./filer_decode /sys/kernel/debug/gfar1/filer_raw
      00: MASK == 00000210 AND         Q:00           ctrl:00000080 prop:00000210
      01: FPR  == 00000210 AND CLE     Q:00           ctrl:00000281 prop:00000210
      02: MASK == ffffffff AND         Q:00           ctrl:00000080 prop:ffffffff
      03: DPT  == 00000003 AND         Q:00           ctrl:0000008e prop:00000003
      04: DIA  == 0a000003             Q:11           ctrl:0000440c prop:0a000003
      05: DPT  == 00000002 AND         Q:00           ctrl:0000008e prop:00000002
      06: DIA  == 0a000002             Q:09           ctrl:0000240c prop:0a000002
      07: DIA  == 0a000001 AND         Q:00           ctrl:0000008c prop:0a000001
      08: DPT  == 00000001     CLE     Q:01           ctrl:0000060e prop:00000001
      ff: MASK >= 00000000             Q:00           ctrl:00000020 prop:00000000
      
      Which looks correct according to the spec but only the first
      (eth id 252)/last added rule for 10.0.0.3 will ever trigger.
      As if filer did not treat the AND CLE as cluster start but
      also kept AND-ing the rules.  We found no errata covering this.
      
      The fact that nobody noticed (2) or (3) makes me think
      that this feature is not very widely used and we should just
      remove it.
      Reported-by: NAleksander Dutkowski <adutkowski@gmail.com>
      Signed-off-by: NJakub Kicinski <kubakici@wp.pl>
      Acked-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f2b7293
    • J
      gianfar: correct list membership accounting · b5c8c890
      Jakub Kicinski 提交于
      At a cost of one line let's make sure .count is correct
      when calling gfar_process_filer_changes().
      Signed-off-by: NJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b5c8c890
    • J
      gianfar: correct filer table writing · a898fe04
      Jakub Kicinski 提交于
      MAX_FILER_IDX is the last usable index.  Using less-than
      will already guarantee that one entry for catch-all rule
      will be left, no need to subtract 1 here.
      Signed-off-by: NJakub Kicinski <kubakici@wp.pl>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a898fe04
    • V
      bonding: Gratuitous ARP gets dropped when first slave added · b02e3e94
      Venkat Venkatsubra 提交于
      When the first slave is added (such as during bootup) the first
      gratuitous ARP gets dropped. We don't see this drop during a failover.
      The packet gets dropped in qdisc (noop_enqueue).
      
      The fix is to delay the sending of gratuitous ARPs till the bond dev's
      carrier is present.
      
      It can also be worked around by setting num_grat_arp to more than 1.
      Signed-off-by: NVenkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b02e3e94
    • M
      sd: Fix maximum I/O size for BLOCK_PC requests · 4f258a46
      Martin K. Petersen 提交于
      Commit bcdb247c ("sd: Limit transfer length") clamped the maximum
      size of an I/O request to the MAXIMUM TRANSFER LENGTH field in the BLOCK
      LIMITS VPD. This had the unfortunate effect of also limiting the maximum
      size of non-filesystem requests sent to the device through sg/bsg.
      
      Avoid using blk_queue_max_hw_sectors() and set the max_sectors queue
      limit directly.
      
      Also update the comment in blk_limits_max_hw_sectors() to clarify that
      max_hw_sectors defines the limit for the I/O controller only.
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Reported-by: NBrian King <brking@linux.vnet.ibm.com>
      Tested-by: NBrian King <brking@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org # 3.17+
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      4f258a46
    • B
      libfc: Fix fc_fcp_cleanup_each_cmd() · 8f2777f5
      Bart Van Assche 提交于
      Since fc_fcp_cleanup_cmd() can sleep this function must not
      be called while holding a spinlock. This patch avoids that
      fc_fcp_cleanup_each_cmd() triggers the following bug:
      
      BUG: scheduling while atomic: sg_reset/1512/0x00000202
      1 lock held by sg_reset/1512:
       #0:  (&(&fsp->scsi_pkt_lock)->rlock){+.-...}, at: [<ffffffffc0225cd5>] fc_fcp_cleanup_each_cmd.isra.21+0xa5/0x150 [libfc]
      Preemption disabled at:[<ffffffffc0225cd5>] fc_fcp_cleanup_each_cmd.isra.21+0xa5/0x150 [libfc]
      Call Trace:
       [<ffffffff816c612c>] dump_stack+0x4f/0x7b
       [<ffffffff810828bc>] __schedule_bug+0x6c/0xd0
       [<ffffffff816c87aa>] __schedule+0x71a/0xa10
       [<ffffffff816c8ad2>] schedule+0x32/0x80
       [<ffffffffc0217eac>] fc_seq_set_resp+0xac/0x100 [libfc]
       [<ffffffffc0218b11>] fc_exch_done+0x41/0x60 [libfc]
       [<ffffffffc0225cff>] fc_fcp_cleanup_each_cmd.isra.21+0xcf/0x150 [libfc]
       [<ffffffffc0225f43>] fc_eh_device_reset+0x1c3/0x270 [libfc]
       [<ffffffff814a2cc9>] scsi_try_bus_device_reset+0x29/0x60
       [<ffffffff814a3908>] scsi_ioctl_reset+0x258/0x2d0
       [<ffffffff814a2650>] scsi_ioctl+0x150/0x440
       [<ffffffff814b3a9d>] sd_ioctl+0xad/0x120
       [<ffffffff8132f266>] blkdev_ioctl+0x1b6/0x810
       [<ffffffff811da608>] block_ioctl+0x38/0x40
       [<ffffffff811b4e08>] do_vfs_ioctl+0x2f8/0x530
       [<ffffffff811b50c1>] SyS_ioctl+0x81/0xa0
       [<ffffffff816cf8b2>] system_call_fastpath+0x16/0x7a
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      8f2777f5
    • B
      libfc: Fix fc_exch_recv_req() error path · f6979ade
      Bart Van Assche 提交于
      Due to patch "libfc: Do not invoke the response handler after
      fc_exch_done()" (commit ID 7030fd62) the lport_recv() call
      in fc_exch_recv_req() is passed a dangling pointer. Avoid this
      by moving the fc_frame_free() call from fc_invoke_resp() to its
      callers. This patch fixes the following crash:
      
      general protection fault: 0000 [#3] PREEMPT SMP
      RIP: fc_lport_recv_req+0x72/0x280 [libfc]
      Call Trace:
       fc_exch_recv+0x642/0xde0 [libfc]
       fcoe_percpu_receive_thread+0x46a/0x5ed [fcoe]
       kthread+0x10a/0x120
       ret_from_fork+0x42/0x70
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NVasu Dev <vasu.dev@intel.com>
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      f6979ade
    • J
      libiscsi: Fix host busy blocking during connection teardown · 660d0831
      John Soni Jose 提交于
      In case of hw iscsi offload, an host can have N-number of active
      connections. There can be IO's running on some connections which
      make host->host_busy always TRUE. Now if logout from a connection
      is tried then the code gets into an infinite loop as host->host_busy
      is always TRUE.
      
       iscsi_conn_teardown(....)
       {
         .........
          /*
           * Block until all in-progress commands for this connection
           * time out or fail.
           */
           for (;;) {
            spin_lock_irqsave(session->host->host_lock, flags);
            if (!atomic_read(&session->host->host_busy)) { /* OK for ERL == 0 */
      	      spin_unlock_irqrestore(session->host->host_lock, flags);
                    break;
            }
           spin_unlock_irqrestore(session->host->host_lock, flags);
           msleep_interruptible(500);
           iscsi_conn_printk(KERN_INFO, conn, "iscsi conn_destroy(): "
                       "host_busy %d host_failed %d\n",
      	          atomic_read(&session->host->host_busy),
      	          session->host->host_failed);
      
      	................
      	...............
           }
        }
      
      This is not an issue with software-iscsi/iser as each cxn is a separate
      host.
      
      Fix:
      Acquiring eh_mutex in iscsi_conn_teardown() before setting
      session->state = ISCSI_STATE_TERMINATE.
      Signed-off-by: NJohn Soni Jose <sony.john@avagotech.com>
      Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
      Reviewed-by: NChris Leech <cleech@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJames Bottomley <JBottomley@Odin.com>
      660d0831
    • A
      Revert "drm/amdgpu: Configure doorbell to maximum slots" · b8826b0c
      Alex Deucher 提交于
      This reverts commit 78ad5cdd.
      This commit breaks dpm and suspend/resume on CZ.
      b8826b0c
    • B
  5. 12 8月, 2015 6 次提交
    • Y
      dm cache policy smq: move 'dm-cache-default' module alias to SMQ · 34dd0517
      Yi Zhang 提交于
      When creating dm-cache with the default policy, it will call
      request_module("dm-cache-default") to register the default policy.
      But the "dm-cache-default" alias was left referring to the MQ policy.
      Fix this by moving the module alias to SMQ.
      
      Fixes: bccab6a0 (dm cache: switch the "default" cache replacement policy from mq to smq)
      Signed-off-by: NYi Zhang <yizhan@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      34dd0517
    • J
      dm btree: add ref counting ops for the leaves of top level btrees · b0dc3c8b
      Joe Thornber 提交于
      When using nested btrees, the top leaves of the top levels contain
      block addresses for the root of the next tree down.  If we shadow a
      shared leaf node the leaf values (sub tree roots) should be incremented
      accordingly.
      
      This is only an issue if there is metadata sharing in the top levels.
      Which only occurs if metadata snapshots are being used (as is possible
      with dm-thinp).  And could result in a block from the thinp metadata
      snap being reused early, thus corrupting the thinp metadata snap.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      b0dc3c8b
    • J
      dm thin metadata: delete btrees when releasing metadata snapshot · 7f518ad0
      Joe Thornber 提交于
      The device details and mapping trees were just being decremented
      before.  Now btree_del() is called to do a deep delete.
      Signed-off-by: NJoe Thornber <ejt@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Cc: stable@vger.kernel.org
      7f518ad0
    • T
      memory: omap-gpmc: Don't try to save uninitialized GPMC context · e984a179
      Tomeu Vizoso 提交于
      If for some reason the GPMC device hasn't been probed yet, gpmc_base is
      going to be NULL. Because there's no context yet to be saved, just turn
      these functions into no-ops until that device gets probed.
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000010
      pgd = c0204000
      [00000010] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP ARM
      Modules linked in:
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc5-next-20150804-05947-g23f38fe8eda9 #1
      Hardware name: Generic OMAP3-GP (Flattened Device Tree)
      task: c0e623e8 ti: c0e5c000 task.ti: c0e5c000
      PC is at omap3_gpmc_save_context+0x8/0xc4
      LR is at omap_sram_idle+0x154/0x23c
      pc : [<c087c7ac>]    lr : [<c023262c>]    psr: 60000193
      sp : c0e5df40  ip : c0f92a80  fp : c0999eb0
      r10: c0e57364  r9 : c0e66f14  r8 : 00000003
      r7 : 00000000  r6 : 00000003  r5 : 00000000  r4 : c0f5f174
      r3 : c0fa4fe8  r2 : 00000000  r1 : 00000000  r0 : fa200280
      Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 80204019  DAC: 00000015
      Process swapper/0 (pid: 0, stack limit = 0xc0e5c220)
      Stack: (0xc0e5df40 to 0xc0e5e000)
      df40: 00000000 c0e66ef8 c0f5f1a4 00000000 00000003 c02333a4 c3813822 00000000
      df60: 00000000 c0e5a5c8 cfb8a5d0 c07f0c44 0e4f1d7e 00000000 00000000 00000000
      df80: c3813822 00000000 cfb8a5d0 c0e5e4e4 cfb8a5d0 c0e66f14 c0e5a5c8 c0e5e54c
      dfa0: c0e5e544 c0e57364 c0999eb0 c0277758 000000fa c0f5d000 00000000 c0d61c18
      dfc0: ffffffff ffffffff 00000000 c0d61674 00000000 c0df7a48 00000000 c0f5d5d4
      dfe0: c0e5e4c0 c0df7a44 c0e634f8 80204059 00000000 8020807c 00000000 00000000
      [<c087c7ac>] (omap3_gpmc_save_context) from [<c023262c>] (omap_sram_idle+0x154/0x23c)
      [<c023262c>] (omap_sram_idle) from [<c02333a4>] (omap3_enter_idle_bm+0xec/0x1a8)
      [<c02333a4>] (omap3_enter_idle_bm) from [<c07f0c44>] (cpuidle_enter_state+0xbc/0x284)
      [<c07f0c44>] (cpuidle_enter_state) from [<c0277758>] (cpu_startup_entry+0x174/0x24c)
      [<c0277758>] (cpu_startup_entry) from [<c0d61c18>] (start_kernel+0x358/0x3c0)
      [<c0d61c18>] (start_kernel) from [<8020807c>] (0x8020807c)
      Code: c0ccace8 c0ccacc0 e59f30b4 e5932000 (e5921010)
      Signed-off-by: NTomeu Vizoso <tomeu.vizoso@collabora.com>
      Suggested-by: NJavier Martinez Canillas <javier@dowhile0.org>
      Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: NRoger Quadros <rogerq@ti.com>
      [tony@atomide.com: updated description as suggested by Javier]
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      e984a179
    • L
      net: fs_enet: mask interrupts for TX partial frames. · c68875fa
      LEROY Christophe 提交于
      We are not interested in interrupts for partially transmitted frames.
      Unlike SCC and FCC, the FEC doesn't handle the I bit in buffer
      descriptors, instead it defines two interrupt bits, TXB and TXF.
      
      We have to mask TXB in order to only get interrupts once the
      frame is fully transmitted.
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c68875fa
    • L
      net: fs_enet: explicitly remove I flag on TX partial frames · 8961822c
      LEROY Christophe 提交于
      We are not interested in interrupts for partially transmitted frames,
      we have to clear BD_ENET_TX_INTR explicitly otherwise it may remain
      from a previously used descriptor.
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8961822c
  6. 11 8月, 2015 10 次提交