1. 24 May, 2016 8 commits
    • Andreas Gruenbacher's avatar
      ubifs: ubifs_dump_inode: Fix dumping field bulk_read · 1112018c
      Andreas Gruenbacher authored
      The wrong field (xattr) is dumped here due to a copy-and-paste error.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      1112018c
    • Richard Weinberger's avatar
      UBI: Fix static volume checks when Fastmap is used · 1900149c
      Richard Weinberger authored
      Ezequiel reported that he's facing UBI going into read-only
      mode after power cut. It turned out that this behavior happens
      only when updating a static volume is interrupted and Fastmap is
      used.
      
      A possible trace can look like:
      ubi0 warning: ubi_io_read_vid_hdr [ubi]: no VID header found at PEB 2323, only 0xFF bytes
      ubi0 warning: ubi_eba_read_leb [ubi]: switch to read-only mode
      CPU: 0 PID: 833 Comm: ubiupdatevol Not tainted 4.6.0-rc2-ARCH #4
      Hardware name: SAMSUNG ELECTRONICS CO., LTD. 300E4C/300E5C/300E7C/NP300E5C-AD8AR, BIOS P04RAP 10/15/2012
      0000000000000286 00000000eba949bd ffff8800c45a7b38 ffffffff8140d841
      ffff8801964be000 ffff88018eaa4800 ffff8800c45a7bb8 ffffffffa003abf6
      ffffffff850e2ac0 8000000000000163 ffff8801850e2ac0 ffff8801850e2ac0
      Call Trace:
      [<ffffffff8140d841>] dump_stack+0x63/0x82
      [<ffffffffa003abf6>] ubi_eba_read_leb+0x486/0x4a0 [ubi]
      [<ffffffffa00453b3>] ubi_check_volume+0x83/0xf0 [ubi]
      [<ffffffffa0039d97>] ubi_open_volume+0x177/0x350 [ubi]
      [<ffffffffa00375d8>] vol_cdev_open+0x58/0xb0 [ubi]
      [<ffffffff8124b08e>] chrdev_open+0xae/0x1d0
      [<ffffffff81243bcf>] do_dentry_open+0x1ff/0x300
      [<ffffffff8124afe0>] ? cdev_put+0x30/0x30
      [<ffffffff81244d36>] vfs_open+0x56/0x60
      [<ffffffff812545f4>] path_openat+0x4f4/0x1190
      [<ffffffff81256621>] do_filp_open+0x91/0x100
      [<ffffffff81263547>] ? __alloc_fd+0xc7/0x190
      [<ffffffff812450df>] do_sys_open+0x13f/0x210
      [<ffffffff812451ce>] SyS_open+0x1e/0x20
      [<ffffffff81a99e32>] entry_SYSCALL_64_fastpath+0x1a/0xa4
      
      UBI checks static volumes for data consistency and reads the
      whole volume upon first open. If the volume is found erroneous
      users of UBI cannot read from it, but another volume update is
      possible to fix it. The check is performed by running
      ubi_eba_read_leb() on every allocated LEB of the volume.
      For static volumes ubi_eba_read_leb() computes the checksum of all
      data stored in a LEB. To verify the computed checksum it has to read
      the LEB's volume header which stores the original checksum.
      If the volume header is not found UBI treats this as fatal internal
      error and switches to RO mode. If the UBI device was attached via a
      full scan the assumption is correct, the volume header has to be
      present as it had to be there while scanning to get known as mapped.
      If the attach operation happened via Fastmap the assumption is no
      longer correct. When attaching via Fastmap UBI learns the mapping
      table from Fastmap's snapshot of the system state and not via a full
      scan. It can happen that a LEB got unmapped after a Fastmap was
      written to the flash. Then UBI can learn the LEB still as mapped and
      accessing it returns only 0xFF bytes. As UBI is not a FTL it is
      allowed to have mappings to empty PEBs, it assumes that the layer
      above takes care of LEB accounting and referencing.
      UBIFS does so using the LEB property tree (LPT).
      For static volumes UBI blindly assumes that all LEBs are present and
      therefore special actions have to be taken.
      
      The described situation can happen when updating a static volume is
      interrupted, either by a user or a power cut.
      The volume update code first unmaps all LEBs of a volume and then
      writes LEB by LEB. If the sequence of operations is interrupted UBI
      detects this either by the absence of LEBs, no volume header present
      at scan time, or corrupted payload, detected via checksum.
      In the Fastmap case the former method won't trigger as no scan
      happened and UBI automatically thinks all LEBs are present.
      Only by reading data from a LEB it detects that the volume header is
      missing and incorrectly treats this as fatal error.
      To deal with the situation ubi_eba_read_leb() from now on checks
      whether we attached via Fastmap and handles the absence of a
      volume header like a data corruption error.
      This way interrupted static volume updates will correctly get detected
      also when Fastmap is used.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Tested-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      1900149c
    • Heiko Schocher's avatar
      UBI: Set free_count to zero before walking through erase list · 73b0cd57
      Heiko Schocher authored
      Set free_count to zero before walking through ai->erase list
      in wl_init().
      
      Found in U-Boot as U-Boot has no workqueue/threads, it immediately
      calls erase_worker(), which increase for each erased block
      free_count. Without this patch, free_count gets after
      this initialized to zero in wl_init(), so the free_count
      variable always has the maybe wrong value 0 in U-Boot.
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      Reviewed-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      73b0cd57
    • Dan Carpenter's avatar
      UBI: Silence an unintialized variable warning · 24663e72
      Dan Carpenter authored
      My static checker complains that "val" is uninitialized when kstrtoint()
      fails.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      24663e72
    • Dan Carpenter's avatar
      UBI: Clean up return in ubi_remove_volume() · fadb3665
      Dan Carpenter authored
      My static checker says that "err" can be uninitialized if
      "vol->reserved_pebs" is <= 0.  I don't think that can happen but
      returning a literal is cleaner anyway.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      fadb3665
    • z00189512's avatar
      960b35d0
    • Richard Weinberger's avatar
      UBI: Don't read back all data in ubi_eba_copy_leb() · 1e0a74f1
      Richard Weinberger authored
      Drop this paranoia check from the old days.
      If our MTD driver or the flash is so bad that we even cannot
      trust it to write data we have bigger problems.
      
      If one really does not trust the flash and wants write-verify
      she can enable UBI io checks using debugfs.
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      1e0a74f1
    • Ezequiel Garcia's avatar
      UBI: Add ro-mode sysfs attribute · 525bab71
      Ezequiel Garcia authored
      On serious situations, UBI may detect serious device corruption,
      and switch to read-only mode to protect the data and allow debugging.
      This commit exposes this ro-mode on sysfs, so it can be obtained
      by userspace tools.
      Signed-off-by: default avatarEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
      Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
      525bab71
  2. 01 May, 2016 2 commits
  3. 30 Apr, 2016 6 commits
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 1b46bac6
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A few more powerpc fixes for 4.6:
      
         - cxl: Keep IRQ mappings on context teardown from Michael Neuling
      
         - cxl: Poll for outstanding IRQs when detaching a context from
           Michael Neuling
      
         - Wire up preadv2 and pwritev2 syscalls from Rui Salvaterra"
      
      * tag 'powerpc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: wire up preadv2 and pwritev2 syscalls
        cxl: Poll for outstanding IRQs when detaching a context
        cxl: Keep IRQ mappings on context teardown
      1b46bac6
    • Linus Torvalds's avatar
      Merge tag 'edac_fix_for_4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · 65c4cbeb
      Linus Torvalds authored
      Pull EDAC fix from Borislav Petkov:
       "Make sure sb_edac and i7core_edac do not terminate MCE processing on
        the decoding callchain prematurely"
      
      * tag 'edac_fix_for_4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
        EDAC: i7core, sb_edac: Don't return NOTIFY_BAD from mce_decoder callback
      65c4cbeb
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b49a5195
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "One revert of a recent cpufreq commit that introduced a regression and
        a fix for intel_pstate's Turbo Activation Ratio handling code.
      
        Specifics:
      
         - Revert cpufreq commit that attempted to fix a problem in the
           ondemand/conservative governor code, but did that incorrectly and
           introduced another problem instead (Rafael Wysocki).
      
         - Fix incorrect decoding of MSR contents related to the Turbo
           Activation Ratio (TAR) handling in the intel_pstate driver
           (Srinivas Pandruvada)"
      
      * tag 'pm+acpi-4.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: intel_pstate: Fix processing for turbo activation ratio
        Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"
      b49a5195
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.6-rc4' of git://git.linaro.org/people/ulf.hansson/mmc · a8feb782
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "Here are a two MMC host fixes:
      
        - sdhci-acpi: Reduce Baytrail eMMC/SD/SDIO hangs
      
        - sunxi: Disable eMMC HS-DDR for Allwinner A80"
      
      * tag 'mmc-v4.6-rc4' of git://git.linaro.org/people/ulf.hansson/mmc:
        mmc: sunxi: Disable eMMC HS-DDR (MMC_CAP_1_8V_DDR) for Allwinner A80
        mmc: sdhci-acpi: Reduce Baytrail eMMC/SD/SDIO hangs
      a8feb782
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · b9cc335f
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "A few fixes all over the place:
      
        radeon is probably the biggest standout, it's a fix for screen
        corruption or hung black outputs so I thought it was worth pulling in.
      
        Otherwise some amdgpu power control fixes, some misc vmwgfx fixes, one
        etnaviv fix, one virtio-gpu fix, two DP MST fixes, and a single TTM
        fix"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/vmwgfx: Fix order of operation
        drm/vmwgfx: use vmw_cmd_dx_cid_check for query commands.
        drm/vmwgfx: Enable SVGA_3D_CMD_DX_SET_PREDICATION
        drm/amdgpu: disable vm interrupts with vm_fault_stop=2
        drm/amdgpu: print a message if ATPX dGPU power control is missing
        Revert "drm/amdgpu: disable runtime pm on PX laptops without dGPU power control"
        drm/radeon: fix vertical bars appear on monitor (v2)
        drm/ttm: fix kref count mess in ttm_bo_move_to_lru_tail
        drm/virtio: send vblank event after crtc updates
        drm/dp/mst: Restore primary hub guid on resume
        drm/dp/mst: Get validated port ref in drm_dp_update_payload_part1()
        drm/etnaviv: don't move linear memory window on 3D cores without MC2.0
      b9cc335f
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma · 925d96a0
      Linus Torvalds authored
      Pull rdma fixes from Doug Ledford:
       "Final set of -rc fixes for 4.6.
      
        I've collected up a number of patches that are all pretty small with
        the exception of only a couple.  The hfi1 driver has a number of
        important patches, and it is what really drives the line count of this
        pull request up.  These are all small and I've got this kernel built
        and running in the test lab (I have most of the hardware, I think nes
        is the only thing in this patch set that I can't say I've personally
        tested and have up and running).
      
        Summary:
      
         - A number of collected fixes for oopses, memory corruptions,
           deadlocks, etc.  All of these fixes are small (many only 5-10
           lines), obvious, and tested.
      
         - Fix for the security issue related to the use of write for
           bi-directional communications"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
        RDMA/nes: don't leak skb if carrier down
        IB/security: Restrict use of the write() interface
        IB/hfi1: Use kernel default llseek for ui device
        IB/hfi1: Don't attempt to free resources if initialization failed
        IB/hfi1: Fix missing lock/unlock in verbs drain callback
        IB/rdmavt: Fix send scheduling
        IB/hfi1: Prevent unpinning of wrong pages
        IB/hfi1: Fix deadlock caused by locking with wrong scope
        IB/hfi1: Prevent NULL pointer deferences in caching code
        MAINTAINERS: Update iser/isert maintainer contact info
        IB/mlx5: Expose correct max_sge_rd limit
        RDMA/iw_cxgb4: Fix bar2 virt addr calculation for T4 chips
        iw_cxgb4: handle draining an idle qp
        iw_cxgb3: initialize ibdev.iwcm->ifname for port mapping
        iw_cxgb4: initialize ibdev.iwcm->ifname for port mapping
        IB/core: Don't drain non-existent rq queue-pair
        IB/core: Fix oops in ib_cache_gid_set_default_gid
      925d96a0
  4. 29 Apr, 2016 24 commits