1. 07 9月, 2019 1 次提交
    • A
      gfs2: Improve mmap write vs. truncate consistency · b473bc2d
      Andreas Gruenbacher 提交于
      On filesystems with a block size smaller than PAGE_SIZE, page_mkwrite is
      called for each memory-mapped page before that page can be written to.
      When such a memory-mapped file is truncated down to size x which is not
      a multiple of the page size and then back to a larger size, the page
      straddling size x can end up with a partial block mapping.  In that
      case, make sure to mark that page read-only so that page_mkwrite will be
      called before the page can be written to the next time.
      
      (There is no point in marking the page straddling size x read-only when
      truncating down as writing to memory beyond the end of the file will
      result in SIGBUS instead of growing the file.)
      
      Fixes xfstests generic/029, generic/030 on filesystems with a block size
      smaller than PAGE_SIZE.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      b473bc2d
  2. 05 9月, 2019 5 次提交
    • B
      gfs2: Use async glocks for rename · ad26967b
      Bob Peterson 提交于
      Because s_vfs_rename_mutex is not cluster-wide, multiple nodes can
      reverse the roles of which directories are "old" and which are "new" for
      the purposes of rename. This can cause deadlocks where two nodes end up
      waiting for each other.
      
      There can be several layers of directory dependencies across many nodes.
      
      This patch fixes the problem by acquiring all gfs2_rename's inode glocks
      asychronously and waiting for all glocks to be acquired.  That way all
      inodes are locked regardless of the order.
      
      The timeout value for multiple asynchronous glocks is calculated to be
      the total of the individual wait times for each glock times two.
      
      Since gfs2_exchange is very similar to gfs2_rename, both functions are
      patched in the same way.
      
      A new async glock wait queue, sd_async_glock_wait, keeps a list of
      waiters for these events. If gfs2's holder_wake function detects an
      async holder, it wakes up any waiters for the event. The waiter only
      tests whether any of its requests are still pending.
      
      Since the glocks are sent to dlm asychronously, the wait function needs
      to check to see which glocks, if any, were granted.
      
      If a glock is granted by dlm (and therefore held), its minimum hold time
      is checked and adjusted as necessary, as other glock grants do.
      
      If the event times out, all glocks held thus far must be dequeued to
      resolve any existing deadlocks.  Then, if there are any outstanding
      locking requests, we need to loop around and wait for dlm to respond to
      those requests too.  After we release all requests, we return -ESTALE to
      the caller (vfs rename) which loops around and retries the request.
      
          Node1           Node2
          ---------       ---------
      1.  Enqueue A       Enqueue B
      2.  Enqueue B       Enqueue A
      3.  A granted
      6.                  B granted
      7.  Wait for B
      8.                  Wait for A
      9.                  A times out (since Node 1 holds A)
      10.                 Dequeue B (since it was granted)
      11.                 Wait for all requests from DLM
      12. B Granted (since Node2 released it in step 10)
      13. Rename
      14. Dequeue A
      15.                 DLM Grants A
      16.                 Dequeue A (due to the timeout and since we
                          no longer have B held for our task).
      17. Dequeue B
      18.                 Return -ESTALE to vfs
      19.                 VFS retries the operation, goto step 1.
      
      This release-all-locks / acquire-all-locks may slow rename / exchange
      down as both nodes struggle in the same way and do the same thing.
      However, this will only happen when there is contention for the same
      inodes, which ought to be rare.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      ad26967b
    • A
      gfs2: create function gfs2_glock_update_hold_time · 01123cf1
      Andreas Gruenbacher 提交于
      This patch moves the code that updates glock minimum hold
      time to a separate function. This will be called by a future
      patch.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      01123cf1
    • B
      gfs2: separate holder for rgrps in gfs2_rename · bc74aaef
      Bob Peterson 提交于
      Before this patch, gfs2_rename added a holder for the rgrp glock to
      its array of holders, ghs. There's nothing wrong with that, but this
      patch separates it into a separate holder. This is done to ensure
      it's always locked last as per the proper glock lock ordering,
      and also to pave the way for a future patch in which we will
      lock the non-rgrp glocks asynchronously.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      bc74aaef
    • M
      gfs2: Delete an unnecessary check before brelse() · bccaef90
      Markus Elfring 提交于
      The brelse() function tests whether its argument is NULL and then
      returns immediately.  Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      
      [The same applies to brelse() in gfs2_dir_no_add (which Coccinelle
      apparently missed), so fix that as well.]
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      bccaef90
    • A
      gfs2: Minor PAGE_SIZE arithmetic cleanups · 45eb0504
      Andreas Gruenbacher 提交于
      Replace divisions by PAGE_SIZE with shifts by PAGE_SHIFT and similar.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      45eb0504
  3. 03 9月, 2019 4 次提交
  4. 10 8月, 2019 4 次提交
  5. 09 8月, 2019 1 次提交
    • A
      gfs2: gfs2_walk_metadata fix · a27a0c9b
      Andreas Gruenbacher 提交于
      It turns out that the current version of gfs2_metadata_walker suffers
      from multiple problems that can cause gfs2_hole_size to report an
      incorrect size.  This will confuse fiemap as well as lseek with the
      SEEK_DATA flag.
      
      Fix that by changing gfs2_hole_walker to compute the metapath to the
      first data block after the hole (if any), and compute the hole size
      based on that.
      
      Fixes xfstest generic/490.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Reviewed-by: NBob Peterson <rpeterso@redhat.com>
      Cc: stable@vger.kernel.org # v4.18+
      a27a0c9b
  6. 05 8月, 2019 9 次提交
  7. 04 8月, 2019 8 次提交
    • M
      kconfig: Clear "written" flag to avoid data loss · 0c5b6c28
      M. Vefa Bicakci 提交于
      Prior to this commit, starting nconfig, xconfig or gconfig, and saving
      the .config file more than once caused data loss, where a .config file
      that contained only comments would be written to disk starting from the
      second save operation.
      
      This bug manifests itself because the SYMBOL_WRITTEN flag is never
      cleared after the first call to conf_write, and subsequent calls to
      conf_write then skip all of the configuration symbols due to the
      SYMBOL_WRITTEN flag being set.
      
      This commit resolves this issue by clearing the SYMBOL_WRITTEN flag
      from all symbols before conf_write returns.
      
      Fixes: 8e2442a5 ("kconfig: fix missing choice values in auto.conf")
      Cc: linux-stable <stable@vger.kernel.org> # 4.19+
      Signed-off-by: NM. Vefa Bicakci <m.v.b@runbox.com>
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      0c5b6c28
    • L
      Merge tag 'xtensa-20190803' of git://github.com/jcmvbkbc/linux-xtensa · d8778f13
      Linus Torvalds 提交于
      Pull Xtensa fix from Max Filippov:
       "Fix build for xtensa cores with coprocessors that was broken by
        entry/return abstraction patch"
      
      * tag 'xtensa-20190803' of git://github.com/jcmvbkbc/linux-xtensa:
        xtensa: fix build for cores with coprocessors
      d8778f13
    • L
      Merge branch 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · cf6c8aef
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
       "A set of driver fixes for the I2C subsystem"
      
      * 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: s3c2410: Mark expected switch fall-through
        i2c: at91: fix clk_offset for sama5d2
        i2c: at91: disable TXRDY interrupt after sending data
        i2c: iproc: Fix i2c master read more than 63 bytes
        eeprom: at24: make spd world-readable again
      cf6c8aef
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8b7fd679
      Linus Torvalds 提交于
      Pull perf tooling fixes from Thomas Gleixner:
       "A set of updates for perf tools and documentation:
      
        perf header:
          - Prevent a division by zero
          - Deal with an uninitialized warning proper
      
        libbpf:
          - Fix the missiong __WORDSIZE definition for musl & al
      
        UAPI headers:
          - Synchronize kernel headers
      
        Documentation:
          - Fix the memory units for perf.data size"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        libbpf: fix missing __WORDSIZE definition
        perf tools: Fix perf.data documentation units for memory size
        perf header: Fix use of unitialized value warning
        perf header: Fix divide by zero error if f_header.attr_size==0
        tools headers UAPI: Sync if_link.h with the kernel
        tools headers UAPI: Sync sched.h with the kernel
        tools headers UAPI: Sync usbdevice_fs.h with the kernels to get new ioctl
        tools perf beauty: Fix usbdevfs_ioctl table generator to handle _IOC()
        tools headers UAPI: Update tools's copy of drm.h headers
        tools headers UAPI: Update tools's copy of mman.h headers
        tools headers UAPI: Update tools's copy of kvm.h headers
        tools include UAPI: Sync x86's syscalls_64.tbl and generic unistd.h to pick up clone3 and pidfd_open
      8b7fd679
    • L
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0432a0a0
      Linus Torvalds 提交于
      Pull vdso timer fixes from Thomas Gleixner:
       "A series of commits to deal with the regression caused by the generic
        VDSO implementation.
      
        The usage of clock_gettime64() for 32bit compat fallback syscalls
        caused seccomp filters to kill innocent processes because they only
        allow clock_gettime().
      
        Handle the compat syscalls with clock_gettime() as before, which is
        not a functional problem for the VDSO as the legacy compat application
        interface is not y2038 safe anyway. It's just extra fallback code
        which needs to be implemented on every architecture.
      
        It's opt in for now so that it does not break the compile of already
        converted architectures in linux-next. Once these are fixed, the
        #ifdeffery goes away.
      
        So much for trying to be smart and reuse code..."
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        arm64: compat: vdso: Use legacy syscalls as fallback
        x86/vdso/32: Use 32bit syscall fallback
        lib/vdso/32: Provide legacy syscall fallbacks
        lib/vdso: Move fallback invocation to the callers
        lib/vdso/32: Remove inconsistent NULL pointer checks
      0432a0a0
    • L
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · af42e745
      Linus Torvalds 提交于
      Pull irq fixes from Thomas Gleixner:
       "A small bunch of fixes from the irqchip department:
      
         - Fix a couple of UAF on error paths (RZA1, GICv3 ITS)
      
         - Fix iMX GPCv2 trigger setting
      
         - Add missing of_node_put() on error path in MBIGEN
      
         - Add another bunch of /* fall-through */ to silence warnings"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/renesas-rza1: Fix an use-after-free in rza1_irqc_probe()
        irqchip/irq-imx-gpcv2: Forward irq type to parent
        irqchip/irq-mbigen: Add of_node_put() before return
        irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail
        irqchip/gic-v3: Mark expected switch fall-through
      af42e745
    • L
      Merge tag 'xfs-5.3-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · e12b243d
      Linus Torvalds 提交于
      Pull xfs fixes from Darrick Wong:
      
       - Avoid leaking kernel stack contents to userspace
      
       - Fix a potential null pointer dereference in the dabtree scrub code
      
      * tag 'xfs-5.3-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling()
        xfs: fix stack contents leakage in the v1 inumber ioctls
      e12b243d
    • L
      Merge branch 'akpm' (patches from Andrew) · b7aea68a
      Linus Torvalds 提交于
      Merge misc fixes from Andrew Morton:
       "17 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        drivers/acpi/scan.c: document why we don't need the device_hotplug_lock
        memremap: move from kernel/ to mm/
        lib/test_meminit.c: use GFP_ATOMIC in RCU critical section
        asm-generic: fix -Wtype-limits compiler warnings
        cgroup: kselftest: relax fs_spec checks
        mm/memory_hotplug.c: remove unneeded return for void function
        mm/migrate.c: initialize pud_entry in migrate_vma()
        coredump: split pipe command whitespace before expanding template
        page flags: prioritize kasan bits over last-cpuid
        ubsan: build ubsan.c more conservatively
        kasan: remove clang version check for KASAN_STACK
        mm: compaction: avoid 100% CPU usage during compaction when a task is killed
        mm: migrate: fix reference check race between __find_get_block() and migration
        mm: vmscan: check if mem cgroup is disabled or not before calling memcg slab shrinker
        ocfs2: remove set but not used variable 'last_hash'
        Revert "kmemleak: allow to coexist with fault injection"
        kernel/signal.c: fix a kernel-doc markup
      b7aea68a
  8. 03 8月, 2019 8 次提交