1. 10 Jun, 2017 21 commits
  2. 09 Jun, 2017 19 commits
    • Al Viro's avatar
      excessive checks in ufs_write_failed() and ufs_evict_inode() · babef37d
      Al Viro authored
      As it is, short copy in write() to append-only file will fail
      to truncate the excessive allocated blocks.  As the matter of
      fact, all checks in ufs_truncate_blocks() are either redundant
      or wrong for that caller.  As for the only other caller
      (ufs_evict_inode()), we only need the file type checks there.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      babef37d
    • Al Viro's avatar
      ufs_getfrag_block(): we only grab ->truncate_mutex on block creation path · 006351ac
      Al Viro authored
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      006351ac
    • Al Viro's avatar
      ufs_extend_tail(): fix the braino in calling conventions of ufs_new_fragments() · 940ef1a0
      Al Viro authored
      ... and it really needs splitting into "new" and "extend" cases, but that's for
      later
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      940ef1a0
    • Al Viro's avatar
      ufs: set correct ->s_maxsize · 6b0d144f
      Al Viro authored
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      6b0d144f
    • Al Viro's avatar
      ufs: restore maintaining ->i_blocks · eb315d2a
      Al Viro authored
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      eb315d2a
    • Al Viro's avatar
      fix ufs_isblockset() · 414cf718
      Al Viro authored
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      414cf718
    • Al Viro's avatar
      ufs: restore proper tail allocation · 8785d84d
      Al Viro authored
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      8785d84d
    • Omar Sandoval's avatar
      Btrfs: fix delalloc accounting leak caused by u32 overflow · 70e7af24
      Omar Sandoval authored
      btrfs_calc_trans_metadata_size() does an unsigned 32-bit multiplication,
      which can overflow if num_items >= 4 GB / (nodesize * BTRFS_MAX_LEVEL * 2).
      For a nodesize of 16kB, this overflow happens at 16k items. Usually,
      num_items is a small constant passed to btrfs_start_transaction(), but
      we also use btrfs_calc_trans_metadata_size() for metadata reservations
      for extent items in btrfs_delalloc_{reserve,release}_metadata().
      
      In drop_outstanding_extents(), num_items is calculated as
      inode->reserved_extents - inode->outstanding_extents. The difference
      between these two counters is usually small, but if many delalloc
      extents are reserved and then the outstanding extents are merged in
      btrfs_merge_extent_hook(), the difference can become large enough to
      overflow in btrfs_calc_trans_metadata_size().
      
      The overflow manifests itself as a leak of a multiple of 4 GB in
      delalloc_block_rsv and the metadata bytes_may_use counter. This in turn
      can cause early ENOSPC errors. Additionally, these WARN_ONs in
      extent-tree.c will be hit when unmounting:
      
          WARN_ON(fs_info->delalloc_block_rsv.size > 0);
          WARN_ON(fs_info->delalloc_block_rsv.reserved > 0);
          WARN_ON(space_info->bytes_pinned > 0 ||
                  space_info->bytes_reserved > 0 ||
                  space_info->bytes_may_use > 0);
      
      Fix it by casting nodesize to a u64 so that
      btrfs_calc_trans_metadata_size() does a full 64-bit multiplication.
      While we're here, do the same in btrfs_calc_trunc_metadata_size(); this
      can't overflow with any existing uses, but it's better to be safe here
      than have another hard-to-debug problem later on.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      70e7af24
    • Liu Bo's avatar
      Btrfs: clear EXTENT_DEFRAG bits in finish_ordered_io · 452e62b7
      Liu Bo authored
      Before this, we use 'filled' mode here, ie. if all range has been
      filled with EXTENT_DEFRAG bits, get to clear it, but if the defrag
      range joins the adjacent delalloc range, then we'll have EXTENT_DEFRAG
      bits in extent_state until releasing this inode's pages, and that
      prevents extent_data from being freed.
      
      This clears the bit if any was found within the ordered extent.
      Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      452e62b7
    • Su Yue's avatar
      btrfs: tree-log.c: Wrong printk information about namelen · 286b92f4
      Su Yue authored
      In verify_dir_item, it wants to printk name_len of dir_item but
      printk data_len acutally.
      
      Fix it by calling btrfs_dir_name_len instead of btrfs_dir_data_len.
      Signed-off-by: default avatarSu Yue <suy.fnst@cn.fujitsu.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarChris Mason <clm@fb.com>
      286b92f4
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.12b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · eb4125df
      Linus Torvalds authored
      Pull xen fix from Juergen Gross:
       "A fix for Xen on ARM when dealing with 64kB page size of a guest"
      
      * tag 'for-linus-4.12b-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/privcmd: Support correctly 64KB page granularity when mapping memory
      eb4125df
    • Dmitry Torokhov's avatar
      Input: synaptics-rmi4 - register F03 port as pass-through serio · a0897d5f
      Dmitry Torokhov authored
      The 5th generation Thinkpad X1 Carbons use Synaptics touchpads accessible
      over SMBus/RMI, combined with ALPS or Elantech trackpoint devices instead
      of classic IBM/Lenovo trackpoints. Unfortunately there is no way for ALPS
      driver to detect whether it is dealing with touchpad + trackpoint
      combination or just a trackpoint, so we end up with a "phantom" dualpoint
      ALPS device in addition to real touchpad and trackpoint.
      
      Given that we do not have any special advanced handling for ALPS or
      Elantech trackpoints (unlike IBM trackpoints that have separate driver and
      a host of options) we are better off keeping the trackpoints in PS/2
      emulation mode. We achieve that by setting serio type to SERIO_PS_PSTHRU,
      which will limit number of protocols psmouse driver will try. In addition
      to getting rid of the "phantom" touchpads, this will also speed up probing
      of F03 pass-through port.
      Reported-by: default avatarDamjan Georgievski <gdamjan@gmail.com>
      Suggested-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Acked-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      a0897d5f
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a92f63cd
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Mostly fairly minor, of note are:
      
         - Fix percpu allocations to be NUMA aware
      
         - Limit 4k page size config to 64TB virtual address space
      
         - Avoid needlessly restoring FP and vector registers
      
        Thanks to Aneesh Kumar K.V, Breno Leitao, Christophe Leroy, Frederic
        Barrat, Madhavan Srinivasan, Michael Bringmann, Nicholas Piggin,
        Vaibhav Jain"
      
      * tag 'powerpc-4.12-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/book3s64: Move PPC_DT_CPU_FTRs and enable it by default
        powerpc/mm/4k: Limit 4k page size config to 64TB virtual address space
        cxl: Fix error path on bad ioctl
        powerpc/perf: Fix Power9 test_adder fields
        powerpc/numa: Fix percpu allocations to be NUMA aware
        cxl: Avoid double free_irq() for psl,slice interrupts
        powerpc/kernel: Initialize load_tm on task creation
        powerpc/kernel: Fix FP and vector register restoration
        powerpc/64: Reclaim CPU_FTR_SUBCORE
        powerpc/hotplug-mem: Fix missing endian conversion of aa_index
        powerpc/sysdev/simple_gpio: Fix oops in gpio save_regs function
        powerpc/spufs: Fix coredump of SPU contexts
        powerpc/64s: Add dt_cpu_ftrs boot time setup option
      a92f63cd
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 788a73f4
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "Been sitting on these for a couple of weeks waiting on some larger
        batches to come in but it's been pretty quiet.
      
        Just your garden variety fixes here:
      
         - A few maintainers updates (ep93xx, Exynos, TI, Marvell)
         - Some PM fixes for Atmel/at91 and Marvell
         - A few DT fixes for Marvell, Versatile, TI Keystone, bcm283x
         - A reset driver patch to set module license for symbol access"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        MAINTAINERS: EP93XX: Update maintainership
        MAINTAINERS: remove kernel@stlinux.com obsolete mailing list
        ARM: dts: versatile: use #include "..." to include local DT
        MAINTAINERS: add device-tree files to TI DaVinci entry
        ARM: at91: select CONFIG_ARM_CPU_SUSPEND
        ARM: dts: keystone-k2l: fix broken Ethernet due to disabled OSR
        arm64: defconfig: enable some core options for 64bit Rockchip socs
        arm64: marvell: dts: fix interrupts in 7k/8k crypto nodes
        reset: hi6220: Set module license so that it can be loaded
        MAINTAINERS: add irqchip related drivers to Marvell EBU maintainers
        MAINTAINERS: sort F entries for Marvell EBU maintainers
        ARM: davinci: PM: Do not free useful resources in normal path in 'davinci_pm_init'
        ARM: davinci: PM: Free resources in error handling path in 'davinci_pm_init'
        ARM: dts: bcm283x: Reserve first page for firmware
        memory: atmel-ebi: mark PM ops as __maybe_unused
        MAINTAINERS: Remove Javier Martinez Canillas as reviewer for Exynos
      788a73f4
    • Dave Young's avatar
      efi: Fix boot panic because of invalid BGRT image address · 792ef14d
      Dave Young authored
      Maniaxx reported a kernel boot crash in the EFI code, which I emulated
      by using same invalid phys addr in code:
      
        BUG: unable to handle kernel paging request at ffffffffff280001
        IP: efi_bgrt_init+0xfb/0x153
        ...
        Call Trace:
         ? bgrt_init+0xbc/0xbc
         acpi_parse_bgrt+0xe/0x12
         acpi_table_parse+0x89/0xb8
         acpi_boot_init+0x445/0x4e2
         ? acpi_parse_x2apic+0x79/0x79
         ? dmi_ignore_irq0_timer_override+0x33/0x33
         setup_arch+0xb63/0xc82
         ? early_idt_handler_array+0x120/0x120
         start_kernel+0xb7/0x443
         ? early_idt_handler_array+0x120/0x120
         x86_64_start_reservations+0x29/0x2b
         x86_64_start_kernel+0x154/0x177
         secondary_startup_64+0x9f/0x9f
      
      There is also a similar bug filed in bugzilla.kernel.org:
      
        https://bugzilla.kernel.org/show_bug.cgi?id=195633
      
      The crash is caused by this commit:
      
        7b0a9114 efi/x86: Move the EFI BGRT init code to early init code
      
      The root cause is the firmware on those machines provides invalid BGRT
      image addresses.
      
      In a kernel before above commit BGRT initializes late and uses ioremap()
      to map the image address. Ioremap validates the address, if it is not a
      valid physical address ioremap() just fails and returns. However in current
      kernel EFI BGRT initializes early and uses early_memremap() which does not
      validate the image address, and kernel panic happens.
      
      According to ACPI spec the BGRT image address should fall into
      EFI_BOOT_SERVICES_DATA, see the section 5.2.22.4 of below document:
      
        http://www.uefi.org/sites/default/files/resources/ACPI_6_1.pdf
      
      Fix this issue by validating the image address in efi_bgrt_init(). If the
      image address does not fall into any EFI_BOOT_SERVICES_DATA areas we just
      bail out with a warning message.
      Reported-by: default avatarManiaxx <tripleshiftone@gmail.com>
      Signed-off-by: default avatarDave Young <dyoung@redhat.com>
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matt Fleming <matt@codeblueprint.co.uk>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-efi@vger.kernel.org
      Fixes: 7b0a9114 ("efi/x86: Move the EFI BGRT init code to early init code")
      Link: http://lkml.kernel.org/r/20170609084558.26766-2-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      792ef14d
    • Ingo Molnar's avatar
      Merge branch 'rcu/urgent' of... · 8affb067
      Ingo Molnar authored
      Merge branch 'rcu/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into rcu/urgent
      
      Pull RCU fix from Paul E. McKenney:
      
      " This series enables srcu_read_lock() and srcu_read_unlock() to be used from
        interrupt handlers, which fixes a bug in KVM's use of SRCU in delivery
        of interrupts to guest OSes. "
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8affb067
    • Dave Airlie's avatar
      Merge branch 'vmwgfx-fixes-4.12' of git://people.freedesktop.org/~thomash/linux into drm-fixes · 6e88007e
      Dave Airlie authored
      A bunch of fixes for vmwgfx 4.12 regressions and older stuff. In the latter
      case either trivial, cc'd stable or requiring backports for stable.
      
      * 'vmwgfx-fixes-4.12' of git://people.freedesktop.org/~thomash/linux:
        drm/vmwgfx: Bump driver minor and date
        drm/vmwgfx: Remove unused legacy cursor functions
        drm/vmwgfx: fix spelling mistake "exeeds" -> "exceeds"
        drm/vmwgfx: Fix large topology crash
        drm/vmwgfx: Make sure to update STDU when FB is updated
        drm/vmwgfx: Make sure backup_handle is always valid
        drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve()
        drm/vmwgfx: Don't create proxy surface for cursor
        drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl()
      6e88007e
    • Dave Airlie's avatar
      Merge tag 'drm-intel-fixes-2017-06-08' of... · 3d76917f
      Dave Airlie authored
      Merge tag 'drm-intel-fixes-2017-06-08' of git://anongit.freedesktop.org/git/drm-intel into drm-fixes
      
      drm/i915 fixes for v4.12-rc5
      
      * tag 'drm-intel-fixes-2017-06-08' of git://anongit.freedesktop.org/git/drm-intel:
        drm/i915: fix warning for unused variable
        drm/i915: Fix 90/270 rotated coordinates for FBC
        drm/i915: Restore has_fbc=1 for ILK-M
        drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail
        drm/i915: Fix logical inversion for gen4 quirking
        drm/i915: Guard against i915_ggtt_disable_guc() being invoked unconditionally
        drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2.
        drm/i915: Prevent the system suspend complete optimization
        drm/i915/psr: disable psr2 for resolution greater than 32X20
        drm/i915: Hold a wakeref for probing the ring registers
        drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle
        drm/i915: Disable decoupled MMIO
        drm/i915/guc: Remove stale comment for q_fail
        drm/i915: Serialize GTT/Aperture accesses on BXT
      3d76917f
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2017-06-07' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes · b62dba55
      Dave Airlie authored
      Driver Changes:
      - kirin: Use correct dt port for the bridge (John)
      - meson: Fix regression caused by adding HDMI support to allow board
      	 configurations without HDMI (Neil)
      
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      
      * tag 'drm-misc-fixes-2017-06-07' of git://anongit.freedesktop.org/git/drm-misc:
        drm/meson: Fix driver bind when only CVBS is available
        drm: kirin: Fix drm_of_find_panel_or_bridge conversion
      b62dba55