1. 01 Dec, 2017 11 commits
    • Shaohua Li's avatar
      md/raid1/10: add missed blk plug · 18022a1b
      Shaohua Li authored
      flush_pending_writes isn't always called with block plug, so add it, and plug
      works in nested way.
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      18022a1b
    • Nate Dailey's avatar
      md: limit mdstat resync progress to max_sectors · d2e2ec82
      Nate Dailey authored
      There is a small window near the end of md_do_sync where mddev->curr_resync
      can be equal to MaxSector.
      
      If status_resync is called during this window, the resulting /proc/mdstat
      output contains a HUGE number of = signs due to the very large curr_resync:
      
      Personalities : [raid1]
      md123 : active raid1 sdd3[2] sdb3[0]
        204736 blocks super 1.0 [2/1] [U_]
        [=====================================================================
         ... (82 MB more) ...
         ================>]  recovery =429496729.3% (9223372036854775807/204736)
         finish=0.2min speed=12796K/sec
        bitmap: 0/1 pages [0KB], 65536KB chunk
      
      Modify status_resync to ensure the resync variable doesn't exceed
      the array's max_sectors.
      Signed-off-by: default avatarNate Dailey <nate.dailey@stratus.com>
      Acked-by: default avatarGuoqing Jiang <gqjiang@suse.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      d2e2ec82
    • Song Liu's avatar
      md/r5cache: move mddev_lock() out of r5c_journal_mode_set() · ff35f58e
      Song Liu authored
      r5c_journal_mode_set() is called by r5c_journal_mode_store() and
      raid_ctr() in dm-raid. We don't need mddev_lock() when calling from
      raid_ctr(). This patch fixes this by moves the mddev_lock() to
      r5c_journal_mode_store().
      
      Cc: stable@vger.kernel.org (v4.13+)
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      ff35f58e
    • bingjingc's avatar
      md/raid5: correct degraded calculation in raid5_error · aff69d89
      bingjingc authored
      When disk failure occurs on new disks for reshape, mddev->degraded
      is not calculated correctly. Faulty bit of the failure device is not
      set before raid5_calc_degraded(conf).
      
      mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/loop[012]
      mdadm /dev/md0 -a /dev/loop3
      mdadm /dev/md0 --grow -n4
      mdadm /dev/md0 -f /dev/loop3 # simulating disk failure
      
      cat /sys/block/md0/md/degraded # it outputs 0, but it should be 1.
      
      However, mdadm -D /dev/md0 will show that it is degraded. It's a bug.
      It can be fixed by moving the resources raid5_calc_degraded() depends
      on before it.
      Reported-by: default avatarRoy Chung <roychung@synology.com>
      Reviewed-by: default avatarAlex Wu <alexwu@synology.com>
      Signed-off-by: default avatarBingJing Chang <bingjingc@synology.com>
      Signed-off-by: default avatarShaohua Li <shli@fb.com>
      aff69d89
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a0651c7f
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "Two fixes for nasty kexec/kdump crashes in certain configurations.
      
        A couple of minor fixes for the new TIDR code.
      
        A fix for an oops in a CXL error handling path.
      
        Thanks to: Andrew Donnellan, Christophe Lombard, David Gibson, Mahesh
        Salgaonkar, Vaibhav Jain"
      
      * tag 'powerpc-4.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Do not assign thread.tidr if already assigned
        powerpc: Avoid signed to unsigned conversion in set_thread_tidr()
        powerpc/kexec: Fix kexec/kdump in P9 guest kernels
        powerpc/powernv: Fix kexec crashes caused by tlbie tracing
        cxl: Check if vphb exists before iterating over AFU devices
      a0651c7f
    • Linus Torvalds's avatar
      Merge tag 'afs-fixes-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs · ae753ee2
      Linus Torvalds authored
      Pull AFS fixes from David Howells:
       "Two fix patches for the AFS filesystem:
      
         - Fix the refcounting on permit caching.
      
         - AFS inode (afs_vnode) fields need resetting after allocation
           because they're only initialised when slab pages are obtained from
           the page allocator"
      
      * tag 'afs-fixes-20171201' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
        afs: Properly reset afs_vnode (inode) fields
        afs: Fix permit refcounting
      ae753ee2
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 3c1c4ddf
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Ensure that debugfs files are removed properly
         - Fix missing blk_put_request()
         - Deal with errors from blk_get_request()
         - Rewind mmc bus suspend operations at failures
         - Prepend '0x' to ocr and pre_eol_info in sysfs to identify as hex
      
        MMC host:
         - sdhci-msm: Make it optional to wait for signal level changes
         - sdhci: Avoid swiotlb buffer being full"
      
      * tag 'mmc-v4.15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: core: prepend 0x to OCR entry in sysfs
        mmc: core: prepend 0x to pre_eol_info entry in sysfs
        mmc: sdhci: Avoid swiotlb buffer being full
        mmc: sdhci-msm: Optionally wait for signal level changes
        mmc: block: Ensure that debugfs files are removed
        mmc: core: Do not leave the block driver in a suspended state
        mmc: block: Check return value of blk_get_request()
        mmc: block: Fix missing blk_put_request()
      3c1c4ddf
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.15-rc2' of git://people.freedesktop.org/~airlied/linux · 5dc9cbc4
      Linus Torvalds authored
      Pull drm fixes and cleanups from Dave Airlie:
       "The main thing are a bunch of fixes for the new amd display code, a
        bunch of smatch fixes.
      
        core:
         - Atomic helper regression fix.
         - Deferred fbdev fallout regression fix.
      
        amdgpu:
         - New display code (dc) dpms, suspend/resume and smatch fixes, along
           with some others
         - Some regression fixes for amdkfd/radeon.
         - Fix a ttm regression for swiotlb disabled
      
        bridge:
         - A bunch of fixes for the tc358767 bridge
      
        mali-dp + hdlcd:
         - some fixes and internal API catchups.
      
        imx-drm:
         -regression fix in atomic code.
      
        omapdrm:
         - platform detection regression fixes"
      
      * tag 'drm-fixes-for-v4.15-rc2' of git://people.freedesktop.org/~airlied/linux: (76 commits)
        drm/imx: always call wait_for_flip_done in commit_tail
        omapdrm: hdmi4_cec: signedness bug in hdmi4_cec_init()
        drm: omapdrm: Fix DPI on platforms using the DSI VDDS
        omapdrm: hdmi4: Correct the SoC revision matching
        drm/omap: displays: panel-dpi: add backlight dependency
        drm/omap: Fix error handling path in 'omap_dmm_probe()'
        drm/i915: Disable THP until we have a GPU read BW W/A
        drm/bridge: tc358767: fix 1-lane behavior
        drm/bridge: tc358767: fix AUXDATAn registers access
        drm/bridge: tc358767: fix timing calculations
        drm/bridge: tc358767: fix DP0_MISC register set
        drm/bridge: tc358767: filter out too high modes
        drm/bridge: tc358767: do no fail on hi-res displays
        drm/bridge: Fix lvds-encoder since the panel_bridge rework.
        drm/bridge: synopsys/dw-hdmi: Enable cec clock
        drm/bridge: adv7511/33: Fix adv7511_cec_init() failure handling
        drm/radeon: remove init of CIK VMIDs 8-16 for amdkfd
        drm/ttm: fix populate_and_map() functions once more
        drm/fb_helper: Disable all crtc's when initial setup fails.
        drm/atomic: make drm_atomic_helper_wait_for_vblanks more agressive
        ...
      5dc9cbc4
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 75f64f68
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A selection of fixes/changes that should make it into this series.
        This contains:
      
         - NVMe, two merges, containing:
              - pci-e, rdma, and fc fixes
              - Device quirks
      
         - Fix for a badblocks leak in null_blk
      
         - bcache fix from Rui Hua for a race condition regression where
           -EINTR was returned to upper layers that didn't expect it.
      
         - Regression fix for blktrace for a bug introduced in this series.
      
         - blktrace cleanup for cgroup id.
      
         - bdi registration error handling.
      
         - Small series with cleanups for blk-wbt.
      
         - Various little fixes for typos and the like.
      
        Nothing earth shattering, most important are the NVMe and bcache fixes"
      
      * 'for-linus' of git://git.kernel.dk/linux-block: (34 commits)
        nvme-pci: fix NULL pointer dereference in nvme_free_host_mem()
        nvme-rdma: fix memory leak during queue allocation
        blktrace: fix trace mutex deadlock
        nvme-rdma: Use mr pool
        nvme-rdma: Check remotely invalidated rkey matches our expected rkey
        nvme-rdma: wait for local invalidation before completing a request
        nvme-rdma: don't complete requests before a send work request has completed
        nvme-rdma: don't suppress send completions
        bcache: check return value of register_shrinker
        bcache: recover data from backing when data is clean
        bcache: Fix building error on MIPS
        bcache: add a comment in journal bucket reading
        nvme-fc: don't use bit masks for set/test_bit() numbers
        blk-wbt: fix comments typo
        blk-wbt: move wbt_clear_stat to common place in wbt_done
        blk-sysfs: remove NULL pointer checking in queue_wb_lat_store
        blk-wbt: remove duplicated setting in wbt_init
        nvme-pci: add quirk for delay before CHK RDY for WDC SN200
        block: remove useless assignment in bio_split
        null_blk: fix dev->badblocks leak
        ...
      75f64f68
    • David Howells's avatar
      afs: Properly reset afs_vnode (inode) fields · f8de483e
      David Howells authored
      When an AFS inode is allocated by afs_alloc_inode(), the allocated
      afs_vnode struct isn't necessarily reset from the last time it was used as
      an inode because the slab constructor is only invoked once when the memory
      is obtained from the page allocator.
      
      This means that information can leak from one inode to the next because
      we're not calling kmem_cache_zalloc().  Some of the information isn't
      reset, in particular the permit cache pointer.
      
      Bring the clearances up to date.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      f8de483e
    • David Howells's avatar
      afs: Fix permit refcounting · 1bcab125
      David Howells authored
      Fix four refcount bugs in afs_cache_permit():
      
       (1) When checking the result of the kzalloc(), we can't just return, but
           must put 'permits'.
      
       (2) We shouldn't put permits immediately after hashing a new permit as we
           need to keep the pointer stable so that we can check to see if
           vnode->permit_cache has changed before we decide whether to assign to
           it.
      
       (3) 'permits' is being put twice.
      
       (4) We need to put either the replacement or the thing replaced after the
           assignment to vnode->permit_cache.
      
      Without this, lots of the following are seen:
      
        Kernel BUG at ffffffffa039857b [verbose debug info unavailable]
        ------------[ cut here ]------------
        Kernel BUG at ffffffffa039858a [verbose debug info unavailable]
        ------------[ cut here ]------------
      
      The addresses are in the .text..refcount section of the kafs.ko module.
      Following the relocation records for the __ex_table section shows one to be
      due to the decrement in afs_put_permits() and the other to be key_get() in
      afs_cache_permit().
      
      Occasionally, the following is seen:
      
        refcount_t overflow at afs_cache_permit+0x57d/0x5c0 [kafs] in cc1[562], uid/euid: 0/0
        WARNING: CPU: 0 PID: 562 at kernel/panic.c:657 refcount_error_report+0x9c/0xac
        ...
      Reported-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Tested-by: default avatarMarc Dionne <marc.dionne@auristor.com>
      1bcab125
  2. 30 Nov, 2017 29 commits