1. 17 5月, 2016 6 次提交
    • L
      Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1c19b68a
      Linus Torvalds 提交于
      Pull locking changes from Ingo Molnar:
       "The main changes in this cycle were:
      
         - pvqspinlock statistics fixes (Davidlohr Bueso)
      
         - flip atomic_fetch_or() arguments (Peter Zijlstra)
      
         - locktorture simplification (Paul E.  McKenney)
      
         - documentation updates (SeongJae Park, David Howells, Davidlohr
           Bueso, Paul E McKenney, Peter Zijlstra, Will Deacon)
      
         - various fixes"
      
      * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/atomics: Flip atomic_fetch_or() arguments
        locking/pvqspinlock: Robustify init_qspinlock_stat()
        locking/pvqspinlock: Avoid double resetting of stats
        lcoking/locktorture: Simplify the torture_runnable computation
        locking/Documentation: Clarify that ACQUIRE applies to loads, RELEASE applies to stores
        locking/Documentation: State purpose of memory-barriers.txt
        locking/Documentation: Add disclaimer
        locking/Documentation/lockdep: Fix spelling mistakes
        locking/lockdep: Deinline register_lock_class(), save 2328 bytes
        locking/locktorture: Fix NULL pointer dereference for cleanup paths
        locking/locktorture: Fix deboosting NULL pointer dereference
        locking/Documentation: Mention smp_cond_acquire()
        locking/Documentation: Insert white spaces consistently
        locking/Documentation: Fix formatting inconsistencies
        locking/Documentation: Add missed subsection in TOC
        locking/Documentation: Fix missed s/lock/acquire renames
        locking/Documentation: Clarify relationship of barrier() to control dependencies
      1c19b68a
    • L
      Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 49817c33
      Linus Torvalds 提交于
      Pull EFI updates from Ingo Molnar:
       "The main changes in this cycle were:
      
         - Drop the unused EFI_SYSTEM_TABLES efi.flags bit and ensure the
           ARM/arm64 EFI System Table mapping is read-only (Ard Biesheuvel)
      
         - Add a comment to explain that one of the code paths in the x86/pat
           code is only executed for EFI boot (Matt Fleming)
      
         - Improve Secure Boot status checks on arm64 and handle unexpected
           errors (Linn Crosetto)
      
         - Remove the global EFI memory map variable 'memmap' as the same
           information is already available in efi::memmap (Matt Fleming)
      
         - Add EFI Memory Attribute table support for ARM/arm64 (Ard
           Biesheuvel)
      
         - Add EFI GOP framebuffer support for ARM/arm64 (Ard Biesheuvel)
      
         - Add EFI Bootloader Control driver for storing reboot(2) data in EFI
           variables for consumption by bootloaders (Jeremy Compostella)
      
         - Add Core EFI capsule support (Matt Fleming)
      
         - Add EFI capsule char driver (Kweh, Hock Leong)
      
         - Unify EFI memory map code for ARM and arm64 (Ard Biesheuvel)
      
         - Add generic EFI support for detecting when firmware corrupts CPU
           status register bits (like IRQ flags) when performing EFI runtime
           service calls (Mark Rutland)
      
        ... and other misc cleanups"
      
      * 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (46 commits)
        efivarfs: Make efivarfs_file_ioctl() static
        efi: Merge boolean flag arguments
        efi/capsule: Move 'capsule' to the stack in efi_capsule_supported()
        efibc: Fix excessive stack footprint warning
        efi/capsule: Make efi_capsule_pending() lockless
        efi: Remove unnecessary (and buggy) .memmap initialization from the Xen EFI driver
        efi/runtime-wrappers: Remove ARCH_EFI_IRQ_FLAGS_MASK #ifdef
        x86/efi: Enable runtime call flag checking
        arm/efi: Enable runtime call flag checking
        arm64/efi: Enable runtime call flag checking
        efi/runtime-wrappers: Detect firmware IRQ flag corruption
        efi/runtime-wrappers: Remove redundant #ifdefs
        x86/efi: Move to generic {__,}efi_call_virt()
        arm/efi: Move to generic {__,}efi_call_virt()
        arm64/efi: Move to generic {__,}efi_call_virt()
        efi/runtime-wrappers: Add {__,}efi_call_virt() templates
        efi/arm-init: Reserve rather than unmap the memory map for ARM as well
        efi: Add misc char driver interface to update EFI firmware
        x86/efi: Force EFI reboot to process pending capsules
        efi: Add 'capsule' update support
        ...
      49817c33
    • L
      Merge branch 'core-signals-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 230e51f2
      Linus Torvalds 提交于
      Pull core signal updates from Ingo Molnar:
       "These updates from Stas Sergeev and Andy Lutomirski, improve the
        sigaltstack interface by extending its ABI with the SS_AUTODISARM
        feature, which makes it possible to use swapcontext() in a sighandler
        that works on sigaltstack.  Without this flag, the subsequent signal
        will corrupt the state of the switched-away sighandler.
      
        The inspiration is more robust dosemu signal handling"
      
      * 'core-signals-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        signals/sigaltstack: Change SS_AUTODISARM to (1U << 31)
        signals/sigaltstack: Report current flag bits in sigaltstack()
        selftests/sigaltstack: Fix the sigaltstack test on old kernels
        signals/sigaltstack: If SS_AUTODISARM, bypass on_sig_stack()
        selftests/sigaltstack: Add new testcase for sigaltstack(SS_ONSTACK|SS_AUTODISARM)
        signals/sigaltstack: Implement SS_AUTODISARM flag
        signals/sigaltstack: Prepare to add new SS_xxx flags
        signals/sigaltstack, x86/signals: Unify the x86 sigaltstack check with other architectures
      230e51f2
    • L
      Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a3871bd4
      Linus Torvalds 提交于
      Pull RCU updates from Ingo Molnar:
       "The main changes are:
      
         - Documentation updates, including fixes to the design-level
           requirements documentation and a fixed version of the design-level
           data-structure documentation.  These fixes include removing
           cartoons and getting rid of the html/htmlx duplication.
      
         - Further improvements to the new-age expedited grace periods.
      
         - Miscellaneous fixes.
      
         - Torture-test changes, including a new rcuperf module for measuring
           RCU grace-period performance and scalability, which is useful for
           the expedited-grace-period changes"
      
      * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (56 commits)
        rcutorture: Add boot-time adjustment of leaf fanout
        rcutorture: Add irqs-disabled test for call_rcu()
        rcutorture: Dump trace buffer upon shutdown
        rcutorture: Don't rebuild identical kernel
        rcutorture: Add OS-jitter capability
        documentation: Add documentation for RCU's major data structures
        rcutorture: Convert test duration to seconds early
        torture: Kill qemu, not parent process
        torture: Clarify refusal to run more than one torture test
        rcutorture: Consider FROZEN hotplug notifier transitions
        rcutorture: Remove redundant initialization to zero
        rcuperf: Do not wake up shutdown wait queue if "shutdown" is false.
        rcutorture: Add largish-system rcuperf scenario
        rcutorture: Avoid RCU CPU stall warning and RT throttling
        rcutorture: Add rcuperf holdoff boot parameter to reduce interference
        rcutorture: Make scripts analyze rcuperf trace data, if present
        rcutorture: Make rcuperf collect expedited event-trace data
        rcutorture: Print measure of batching efficiency
        rcutorture: Set rcuperf writer kthreads to real-time priority
        rcutorture: Bind rcuperf reader/writer kthreads to CPUs
        ...
      a3871bd4
    • L
      Merge branch 'core-lib-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 0052af44
      Linus Torvalds 提交于
      Pull core/lib update from Ingo Molnar:
       "This contains a single commit that removes an unused facility that the
        scheduler used to make use of"
      
      * 'core-lib-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        lib/proportions: Remove unused code
      0052af44
    • G
      namei: Improve hash mixing if CONFIG_DCACHE_WORD_ACCESS · 0fed3ac8
      George Spelvin 提交于
      The hash mixing between adding the next 64 bits of name
      was just a bit weak.
      
      Replaced with a still very fast but slightly more effective
      mixing function.
      Signed-off-by: NGeorge Spelvin <linux@horizon.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0fed3ac8
  2. 16 5月, 2016 1 次提交
  3. 15 5月, 2016 6 次提交
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5f95063c
      Linus Torvalds 提交于
      Pull x86 fix from Thomas Gleixner:
       "Just the missing compat entry for the new pread/writev2"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Use compat version for preadv2 and pwritev2
      5f95063c
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 272911b8
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Fix mvneta/bm dependencies, from Arnd Bergmann.
      
       2) RX completion hw bug workaround in bnxt_en, from Michael Chan.
      
       3) Kernel pointer leak in nf_conntrack, from Linus.
      
       4) Hoplimit route attribute limits not enforced properly, from Paolo
          Abeni.
      
       5) qlcnic driver NULL deref fix from Dan Carpenter.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        arm64: bpf: jit JMP_JSET_{X,K}
        net/route: enforce hoplimit max value
        nf_conntrack: avoid kernel pointer value leak in slab name
        drivers: net: xgene: fix register offset
        drivers: net: xgene: fix statistics counters race condition
        drivers: net: xgene: fix ununiform latency across queues
        drivers: net: xgene: fix sharing of irqs
        drivers: net: xgene: fix IPv4 forward crash
        xen-netback: fix extra_info handling in xenvif_tx_err()
        net: mvneta: bm: fix dependencies again
        bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)
        bnxt_en: Add workaround to detect bad opaque in rx completion (part 1)
        qlcnic: potential NULL dereference in qlcnic_83xx_get_minidump_template()
      272911b8
    • Z
      arm64: bpf: jit JMP_JSET_{X,K} · 98397fc5
      Zi Shen Lim 提交于
      Original implementation commit e54bcde3 ("arm64: eBPF JIT compiler")
      had the relevant code paths, but due to an oversight always fail jiting.
      
      As a result, we had been falling back to BPF interpreter whenever a BPF
      program has JMP_JSET_{X,K} instructions.
      
      With this fix, we confirm that the corresponding tests in lib/test_bpf
      continue to pass, and also jited.
      
      ...
      [    2.784553] test_bpf: #30 JSET jited:1 188 192 197 PASS
      [    2.791373] test_bpf: #31 tcpdump port 22 jited:1 325 677 625 PASS
      [    2.808800] test_bpf: #32 tcpdump complex jited:1 323 731 991 PASS
      ...
      [    3.190759] test_bpf: #237 JMP_JSET_K: if (0x3 & 0x2) return 1 jited:1 110 PASS
      [    3.192524] test_bpf: #238 JMP_JSET_K: if (0x3 & 0xffffffff) return 1 jited:1 98 PASS
      [    3.211014] test_bpf: #249 JMP_JSET_X: if (0x3 & 0x2) return 1 jited:1 120 PASS
      [    3.212973] test_bpf: #250 JMP_JSET_X: if (0x3 & 0xffffffff) return 1 jited:1 89 PASS
      ...
      
      Fixes: e54bcde3 ("arm64: eBPF JIT compiler")
      Signed-off-by: NZi Shen Lim <zlim.lnx@gmail.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Acked-by: NYang Shi <yang.shi@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      98397fc5
    • P
      net/route: enforce hoplimit max value · 626abd59
      Paolo Abeni 提交于
      Currently, when creating or updating a route, no check is performed
      in both ipv4 and ipv6 code to the hoplimit value.
      
      The caller can i.e. set hoplimit to 256, and when such route will
       be used, packets will be sent with hoplimit/ttl equal to 0.
      
      This commit adds checks for the RTAX_HOPLIMIT value, in both ipv4
      ipv6 route code, substituting any value greater than 255 with 255.
      
      This is consistent with what is currently done for ADVMSS and MTU
      in the ipv4 code.
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      626abd59
    • L
      nf_conntrack: avoid kernel pointer value leak in slab name · 31b0b385
      Linus Torvalds 提交于
      The slab name ends up being visible in the directory structure under
      /sys, and even if you don't have access rights to the file you can see
      the filenames.
      
      Just use a 64-bit counter instead of the pointer to the 'net' structure
      to generate a unique name.
      
      This code will go away in 4.7 when the conntrack code moves to a single
      kmemcache, but this is the backportable simple solution to avoiding
      leaking kernel pointers to user space.
      
      Fixes: 5b3501fa ("netfilter: nf_conntrack: per netns nf_conntrack_cachep")
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31b0b385
    • L
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 6ba5b85f
      Linus Torvalds 提交于
      Pull vfs fixes from Al Viro:
       "Overlayfs fixes from Miklos, assorted fixes from me.
      
        Stable fodder of varying severity, all sat in -next for a while"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        ovl: ignore permissions on underlying lookup
        vfs: add lookup_hash() helper
        vfs: rename: check backing inode being equal
        vfs: add vfs_select_inode() helper
        get_rock_ridge_filename(): handle malformed NM entries
        ecryptfs: fix handling of directory opening
        atomic_open(): fix the handling of create_error
        fix the copy vs. map logics in blk_rq_map_user_iov()
        do_splice_to(): cap the size before passing to ->splice_read()
      6ba5b85f
  4. 14 5月, 2016 16 次提交
  5. 13 5月, 2016 11 次提交
    • M
      Merge remote-tracking branches 'regulator/fix/axp20x', 'regulator/fix/da9063',... · 9689dab3
      Mark Brown 提交于
      Merge remote-tracking branches 'regulator/fix/axp20x', 'regulator/fix/da9063', 'regulator/fix/gpio' and 'regulator/fix/s2mps11' into regulator-linus
      9689dab3
    • M
      Merge remote-tracking branches 'regmap/fix/be', 'regmap/fix/doc' and... · 2a2cd521
      Mark Brown 提交于
      Merge remote-tracking branches 'regmap/fix/be', 'regmap/fix/doc' and 'regmap/fix/spmi' into regmap-linus
      2a2cd521
    • M
      066a0e0b
    • D
      Merge branch 'drm-fixes-4.6' of git://people.freedesktop.org/~agd5f/linux into drm-fixes · e02aacb6
      Dave Airlie 提交于
      DP mode validation regression fix.
      * 'drm-fixes-4.6' of git://people.freedesktop.org/~agd5f/linux:
        drm/amdgpu: fix DP mode validation
        drm/radeon: fix DP mode validation
      e02aacb6
    • P
      xen-netback: fix extra_info handling in xenvif_tx_err() · 72eec92a
      Paul Durrant 提交于
      Patch 562abd39 "xen-netback: support multiple extra info fragments
      passed from frontend" contained a mistake which can result in an in-
      correct number of responses being generated when handling errors
      encountered when processing packets containing extra info fragments.
      This patch fixes the problem.
      Signed-off-by: NPaul Durrant <paul.durrant@citrix.com>
      Reported-by: NJan Beulich <JBeulich@suse.com>
      Cc: Wei Liu <wei.liu2@citrix.com>
      Acked-by: NWei Liu <wei.liu2@citrix.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      72eec92a
    • I
      Merge tag 'perf-urgent-for-mingo-20160512' of... · 636fa4a7
      Ingo Molnar 提交于
      Merge tag 'perf-urgent-for-mingo-20160512' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
      - Fallback to usermode-only counters when perf_event_paranoid > 1, which
        is the case now (Arnaldo Carvalho de Melo)
      
      - Do not reassign parg after collapse_tree() in libtraceevent, which
        may cause tool crashes (Steven Rostedt)
      
      - Fix the build on Fedora Rawhide, where readdir_r() is deprecated and
        also wrt -Werror=unused-const-variable= + x86_32_regoffset_table on
        !x86_64 (Arnaldo Carvalho de Melo)
      
      - Fix the build on Ubuntu 12.04.5, where dwarf_getlocations() isn't
        available, i.e. libdw-dev < 0.157 (Arnaldo Carvalho de Melo)
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      636fa4a7
    • L
      Merge branch 'akpm' (patches from Andrew) · a2ccb68b
      Linus Torvalds 提交于
      Merge fixes from Andrew Morton:
       "4 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        mm: thp: calculate the mapcount correctly for THP pages during WP faults
        ksm: fix conflict between mmput and scan_get_next_rmap_item
        ocfs2: fix posix_acl_create deadlock
        ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster lock hang
      a2ccb68b
    • A
      mm: thp: calculate the mapcount correctly for THP pages during WP faults · 6d0a07ed
      Andrea Arcangeli 提交于
      This will provide fully accuracy to the mapcount calculation in the
      write protect faults, so page pinning will not get broken by false
      positive copy-on-writes.
      
      total_mapcount() isn't the right calculation needed in
      reuse_swap_page(), so this introduces a page_trans_huge_mapcount()
      that is effectively the full accurate return value for page_mapcount()
      if dealing with Transparent Hugepages, however we only use the
      page_trans_huge_mapcount() during COW faults where it strictly needed,
      due to its higher runtime cost.
      
      This also provide at practical zero cost the total_mapcount
      information which is needed to know if we can still relocate the page
      anon_vma to the local vma. If page_trans_huge_mapcount() returns 1 we
      can reuse the page no matter if it's a pte or a pmd_trans_huge
      triggering the fault, but we can only relocate the page anon_vma to
      the local vma->anon_vma if we're sure it's only this "vma" mapping the
      whole THP physical range.
      
      Kirill A. Shutemov discovered the problem with moving the page
      anon_vma to the local vma->anon_vma in a previous version of this
      patch and another problem in the way page_move_anon_rmap() was called.
      
      Andrew Morton discovered that CONFIG_SWAP=n wouldn't build in a
      previous version, because reuse_swap_page must be a macro to call
      page_trans_huge_mapcount from swap.h, so this uses a macro again
      instead of an inline function. With this change at least it's a less
      dangerous usage than it was before, because "page" is used only once
      now, while with the previous code reuse_swap_page(page++) would have
      called page_mapcount on page+1 and it would have increased page twice
      instead of just once.
      
      Dean Luick noticed an uninitialized variable that could result in a
      rmap inefficiency for the non-THP case in a previous version.
      
      Mike Marciniszyn said:
      
      : Our RDMA tests are seeing an issue with memory locking that bisects to
      : commit 61f5d698 ("mm: re-enable THP")
      :
      : The test program registers two rather large MRs (512M) and RDMA
      : writes data to a passive peer using the first and RDMA reads it back
      : into the second MR and compares that data.  The sizes are chosen randomly
      : between 0 and 1024 bytes.
      :
      : The test will get through a few (<= 4 iterations) and then gets a
      : compare error.
      :
      : Tracing indicates the kernel logical addresses associated with the individual
      : pages at registration ARE correct , the data in the "RDMA read response only"
      : packets ARE correct.
      :
      : The "corruption" occurs when the packet crosse two pages that are not physically
      : contiguous.   The second page reads back as zero in the program.
      :
      : It looks like the user VA at the point of the compare error no longer points to
      : the same physical address as was registered.
      :
      : This patch totally resolves the issue!
      
      Link: http://lkml.kernel.org/r/1462547040-1737-2-git-send-email-aarcange@redhat.comSigned-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Reviewed-by: N"Kirill A. Shutemov" <kirill@shutemov.name>
      Reviewed-by: NDean Luick <dean.luick@intel.com>
      Tested-by: NAlex Williamson <alex.williamson@redhat.com>
      Tested-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Tested-by: NJosh Collier <josh.d.collier@intel.com>
      Cc: Marc Haber <mh+linux-kernel@zugschlus.de>
      Cc: <stable@vger.kernel.org>	[4.5]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6d0a07ed
    • Z
      ksm: fix conflict between mmput and scan_get_next_rmap_item · 7496fea9
      Zhou Chengming 提交于
      A concurrency issue about KSM in the function scan_get_next_rmap_item.
      
      task A (ksmd):				|task B (the mm's task):
      					|
      mm = slot->mm;				|
      down_read(&mm->mmap_sem);		|
      					|
      ...					|
      					|
      spin_lock(&ksm_mmlist_lock);		|
      					|
      ksm_scan.mm_slot go to the next slot;	|
      					|
      spin_unlock(&ksm_mmlist_lock);		|
      					|mmput() ->
      					|	ksm_exit():
      					|
      					|spin_lock(&ksm_mmlist_lock);
      					|if (mm_slot && ksm_scan.mm_slot != mm_slot) {
      					|	if (!mm_slot->rmap_list) {
      					|		easy_to_free = 1;
      					|		...
      					|
      					|if (easy_to_free) {
      					|	mmdrop(mm);
      					|	...
      					|
      					|So this mm_struct may be freed in the mmput().
      					|
      up_read(&mm->mmap_sem);			|
      
      As we can see above, the ksmd thread may access a mm_struct that already
      been freed to the kmem_cache.  Suppose a fork will get this mm_struct from
      the kmem_cache, the ksmd thread then call up_read(&mm->mmap_sem), will
      cause mmap_sem.count to become -1.
      
      As suggested by Andrea Arcangeli, unmerge_and_remove_all_rmap_items has
      the same SMP race condition, so fix it too.  My prev fix in function
      scan_get_next_rmap_item will introduce a different SMP race condition, so
      just invert the up_read/spin_unlock order as Andrea Arcangeli said.
      
      Link: http://lkml.kernel.org/r/1462708815-31301-1-git-send-email-zhouchengming1@huawei.comSigned-off-by: NZhou Chengming <zhouchengming1@huawei.com>
      Suggested-by: NAndrea Arcangeli <aarcange@redhat.com>
      Reviewed-by: NAndrea Arcangeli <aarcange@redhat.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Cc: Geliang Tang <geliangtang@163.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Ding Tianhong <dingtianhong@huawei.com>
      Cc: Li Bin <huawei.libin@huawei.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Cc: Xishi Qiu <qiuxishi@huawei.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7496fea9
    • J
      ocfs2: fix posix_acl_create deadlock · c25a1e06
      Junxiao Bi 提交于
      Commit 702e5bc6 ("ocfs2: use generic posix ACL infrastructure")
      refactored code to use posix_acl_create.  The problem with this function
      is that it is not mindful of the cluster wide inode lock making it
      unsuitable for use with ocfs2 inode creation with ACLs.  For example,
      when used in ocfs2_mknod, this function can cause deadlock as follows.
      The parent dir inode lock is taken when calling posix_acl_create ->
      get_acl -> ocfs2_iop_get_acl which takes the inode lock again.  This can
      cause deadlock if there is a blocked remote lock request waiting for the
      lock to be downconverted.  And same deadlock happened in ocfs2_reflink.
      This fix is to revert back using ocfs2_init_acl.
      
      Fixes: 702e5bc6 ("ocfs2: use generic posix ACL infrastructure")
      Signed-off-by: NTariq Saeed <tariq.x.saeed@oracle.com>
      Signed-off-by: NJunxiao Bi <junxiao.bi@oracle.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c25a1e06
    • J
      ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster lock hang · 5ee0fbd5
      Junxiao Bi 提交于
      Commit 743b5f14 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()")
      introduced this issue.  ocfs2_setattr called by chmod command holds
      cluster wide inode lock when calling posix_acl_chmod.  This latter
      function in turn calls ocfs2_iop_get_acl and ocfs2_iop_set_acl.  These
      two are also called directly from vfs layer for getfacl/setfacl commands
      and therefore acquire the cluster wide inode lock.  If a remote
      conversion request comes after the first inode lock in ocfs2_setattr,
      OCFS2_LOCK_BLOCKED will be set.  And this will cause the second call to
      inode lock from the ocfs2_iop_get_acl() to block indefinetly.
      
      The deleted version of ocfs2_acl_chmod() calls __posix_acl_chmod() which
      does not call back into the filesystem.  Therefore, we restore
      ocfs2_acl_chmod(), modify it slightly for locking as needed, and use that
      instead.
      
      Fixes: 743b5f14 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()")
      Signed-off-by: NTariq Saeed <tariq.x.saeed@oracle.com>
      Signed-off-by: NJunxiao Bi <junxiao.bi@oracle.com>
      Cc: Mark Fasheh <mfasheh@suse.de>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Joseph Qi <joseph.qi@huawei.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5ee0fbd5