1. 01 Feb, 2020 2 commits
  2. 27 Jan, 2020 2 commits
  3. 22 Jan, 2020 3 commits
  4. 21 Jan, 2020 2 commits
  5. 17 Jan, 2020 4 commits
  6. 10 Jan, 2020 15 commits
  7. 05 Jan, 2020 7 commits
    • Linus Torvalds's avatar
      Linux 5.5-rc5 · c79f46a2
      Linus Torvalds authored
      c79f46a2
    • Linus Torvalds's avatar
      Merge tag 'riscv/for-v5.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 768fc661
      Linus Torvalds authored
      Pull RISC-V fixes from Paul Walmsley:
       "Several fixes for RISC-V:
      
         - Fix function graph trace support
      
         - Prefix the CSR IRQ_* macro names with "RV_", to avoid collisions
           with macros elsewhere in the Linux kernel tree named "IRQ_TIMER"
      
         - Use __pa_symbol() when computing the physical address of a kernel
           symbol, rather than __pa()
      
         - Mark the RISC-V port as supporting GCOV
      
        One DT addition:
      
         - Describe the L2 cache controller in the FU540 DT file
      
        One documentation update:
      
         - Add patch acceptance guideline documentation"
      
      * tag 'riscv/for-v5.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        Documentation: riscv: add patch acceptance guidelines
        riscv: prefix IRQ_ macro names with an RV_ namespace
        clocksource: riscv: add notrace to riscv_sched_clock
        riscv: ftrace: correct the condition logic in function graph tracer
        riscv: dts: Add DT support for SiFive L2 cache controller
        riscv: gcov: enable gcov for RISC-V
        riscv: mm: use __pa_symbol for kernel symbols
      768fc661
    • Paul Walmsley's avatar
      Documentation: riscv: add patch acceptance guidelines · 0e194d9d
      Paul Walmsley authored
      Formalize, in kernel documentation, the patch acceptance policy for
      arch/riscv.  In summary, it states that as maintainers, we plan to
      only accept patches for new modules or extensions that have been
      frozen or ratified by the RISC-V Foundation.
      
      We've been following these guidelines for the past few months.  In the
      meantime, we've received quite a bit of feedback that it would be
      helpful to have these guidelines formally documented.
      
      Based on a suggestion from Matthew Wilcox, we also add a link to this
      file to Documentation/process/index.rst, to make this document easier
      to find.  The format of this document has also been changed to align
      to the format outlined in the maintainer entry profiles, in accordance
      with comments from Jon Corbet and Dan Williams.
      Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
      Reviewed-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Krste Asanovic <krste@berkeley.edu>
      Cc: Andrew Waterman <waterman@eecs.berkeley.edu>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      0e194d9d
    • Paul Walmsley's avatar
      riscv: prefix IRQ_ macro names with an RV_ namespace · 2f3035da
      Paul Walmsley authored
      "IRQ_TIMER", used in the arch/riscv CSR header file, is a sufficiently
      generic macro name that it's used by several source files across the
      Linux code base.  Some of these other files ultimately include the
      arch/riscv CSR include file, causing collisions.  Fix by prefixing the
      RISC-V csr.h IRQ_ macro names with an RV_ prefix.
      
      Fixes: a4c3733d ("riscv: abstract out CSR names for supervisor vs machine mode")
      Reported-by: default avatarOlof Johansson <olof@lixom.net>
      Acked-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
      2f3035da
    • Zong Li's avatar
      clocksource: riscv: add notrace to riscv_sched_clock · 9d05c18e
      Zong Li authored
      When enabling ftrace graph tracer, it gets the tracing clock in
      ftrace_push_return_trace().  Eventually, it invokes riscv_sched_clock()
      to get the clock value.  If riscv_sched_clock() isn't marked with
      'notrace', it will call ftrace_push_return_trace() and cause infinite
      loop.
      
      The result of failure as follow:
      
      command: echo function_graph >current_tracer
      [   46.176787] Unable to handle kernel paging request at virtual address ffffffe04fb38c48
      [   46.177309] Oops [#1]
      [   46.177478] Modules linked in:
      [   46.177770] CPU: 0 PID: 256 Comm: $d Not tainted 5.5.0-rc1 #47
      [   46.177981] epc: ffffffe00035e59a ra : ffffffe00035e57e sp : ffffffe03a7569b0
      [   46.178216]  gp : ffffffe000d29b90 tp : ffffffe03a756180 t0 : ffffffe03a756968
      [   46.178430]  t1 : ffffffe00087f408 t2 : ffffffe03a7569a0 s0 : ffffffe03a7569f0
      [   46.178643]  s1 : ffffffe00087f408 a0 : 0000000ac054cda4 a1 : 000000000087f411
      [   46.178856]  a2 : 0000000ac054cda4 a3 : 0000000000373ca0 a4 : ffffffe04fb38c48
      [   46.179099]  a5 : 00000000153e22a8 a6 : 00000000005522ff a7 : 0000000000000005
      [   46.179338]  s2 : ffffffe03a756a90 s3 : ffffffe00032811c s4 : ffffffe03a756a58
      [   46.179570]  s5 : ffffffe000d29fe0 s6 : 0000000000000001 s7 : 0000000000000003
      [   46.179809]  s8 : 0000000000000003 s9 : 0000000000000002 s10: 0000000000000004
      [   46.180053]  s11: 0000000000000000 t3 : 0000003fc815749c t4 : 00000000000efc90
      [   46.180293]  t5 : ffffffe000d29658 t6 : 0000000000040000
      [   46.180482] status: 0000000000000100 badaddr: ffffffe04fb38c48 cause: 000000000000000f
      Signed-off-by: default avatarZong Li <zong.li@sifive.com>
      Reviewed-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      [paul.walmsley@sifive.com: cleaned up patch description]
      Fixes: 92e0d143 ("clocksource/drivers/riscv_timer: Provide the sched_clock")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
      9d05c18e
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 36487907
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "17 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        hexagon: define ioremap_uc
        ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less
        ocfs2: call journal flush to mark journal as empty after journal recovery when mount
        mm/hugetlb: defer freeing of huge pages if in non-task context
        mm/gup: fix memory leak in __gup_benchmark_ioctl
        mm/oom: fix pgtables units mismatch in Killed process message
        fs/posix_acl.c: fix kernel-doc warnings
        hexagon: work around compiler crash
        hexagon: parenthesize registers in asm predicates
        fs/namespace.c: make to_mnt_ns() static
        fs/nsfs.c: include headers for missing declarations
        fs/direct-io.c: include fs/internal.h for missing prototype
        mm: move_pages: return valid node id in status if the page is already on the target node
        memcg: account security cred as well to kmemcg
        kcov: fix struct layout for kcov_remote_arg
        mm/zsmalloc.c: fix the migrated zspage statistics.
        mm/memory_hotplug: shrink zones when offlining memory
      36487907
    • Linus Torvalds's avatar
      Merge tag 'apparmor-pr-2020-01-04' of... · a125bcda
      Linus Torvalds authored
      Merge tag 'apparmor-pr-2020-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor
      
      Pull apparmor fixes from John Johansen:
      
       - performance regression: only get a label reference if the fast path
         check fails
      
       - fix aa_xattrs_match() may sleep while holding a RCU lock
      
       - fix bind mounts aborting with -ENOMEM
      
      * tag 'apparmor-pr-2020-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor:
        apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock
        apparmor: only get a label reference if the fast path check fails
        apparmor: fix bind mounts aborting with -ENOMEM
      a125bcda
  8. 04 Jan, 2020 5 commits
    • John Johansen's avatar
      apparmor: fix aa_xattrs_match() may sleep while holding a RCU lock · 8c62ed27
      John Johansen authored
      aa_xattrs_match() is unfortunately calling vfs_getxattr_alloc() from a
      context protected by an rcu_read_lock. This can not be done as
      vfs_getxattr_alloc() may sleep regardles of the gfp_t value being
      passed to it.
      
      Fix this by breaking the rcu_read_lock on the policy search when the
      xattr match feature is requested and restarting the search if a policy
      changes occur.
      
      Fixes: 8e51f908 ("apparmor: Add support for attaching profiles via xattr, presence and value")
      Reported-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
      Reported-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
      8c62ed27
    • Linus Torvalds's avatar
      Merge tag 'mips_fixes_5.5_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · c420ddda
      Linus Torvalds authored
      Pull MIPS fixes from Paul Burton:
       "A collection of MIPS fixes:
      
         - Fill the struct cacheinfo shared_cpu_map field with sensible
           values, notably avoiding issues with perf which was unhappy in the
           absence of these values.
      
         - A boot fix for Loongson 2E & 2F machines which was fallout from
           some refactoring performed this cycle.
      
         - A Kconfig dependency fix for the Loongson CPU HWMon driver.
      
         - A couple of VDSO fixes, ensuring gettimeofday() behaves
           appropriately for kernel configurations that don't include support
           for a clocksource the VDSO can use & fixing the calling convention
           for the n32 & n64 VDSOs which would previously clobber the $gp/$28
           register.
      
         - A build fix for vmlinuz compressed images which were
           inappropriately building with -fsanitize-coverage despite not being
           part of the kernel proper, then failing to link due to the missing
           __sanitizer_cov_trace_pc() function.
      
         - A couple of eBPF JIT fixes, including disabling it for MIPS32 due
           to a large number of issues with the code generated there &
           reflecting ISA dependencies in Kconfig to enforce that systems
           which don't support the JIT must include the interpreter"
      
      * tag 'mips_fixes_5.5_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: Avoid VDSO ABI breakage due to global register variable
        MIPS: BPF: eBPF JIT: check for MIPS ISA compliance in Kconfig
        MIPS: BPF: Disable MIPS32 eBPF JIT
        MIPS: Prevent link failure with kcov instrumentation
        MIPS: Kconfig: Use correct form for 'depends on'
        mips: Fix gettimeofday() in the vdso library
        MIPS: Fix boot on Fuloong2 systems
        mips: cacheinfo: report shared CPU map
      c420ddda
    • Nick Desaulniers's avatar
      hexagon: define ioremap_uc · 7312b706
      Nick Desaulniers authored
      Similar to commit 38e45d81 ("sparc64: implement ioremap_uc") define
      ioremap_uc for hexagon to avoid errors from
      -Wimplicit-function-definition.
      
      Link: http://lkml.kernel.org/r/20191209222956.239798-2-ndesaulniers@google.com
      Link: https://github.com/ClangBuiltLinux/linux/issues/797
      Fixes: e537654b ("lib: devres: add a helper function for ioremap_uc")
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Suggested-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Acked-by: default avatarBrian Cain <bcain@codeaurora.org>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Tuowen Zhao <ztuowen@gmail.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Alexios Zavras <alexios.zavras@intel.com>
      Cc: Allison Randal <allison@lohutok.net>
      Cc: Will Deacon <will@kernel.org>
      Cc: Richard Fontana <rfontana@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7312b706
    • Gang He's avatar
      ocfs2: fix the crash due to call ocfs2_get_dlm_debug once less · b73eba2a
      Gang He authored
      Because ocfs2_get_dlm_debug() function is called once less here, ocfs2
      file system will trigger the system crash, usually after ocfs2 file
      system is unmounted.
      
      This system crash is caused by a generic memory corruption, these crash
      backtraces are not always the same, for exapmle,
      
          ocfs2: Unmounting device (253,16) on (node 172167785)
          general protection fault: 0000 [#1] SMP PTI
          CPU: 3 PID: 14107 Comm: fence_legacy Kdump:
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
          RIP: 0010:__kmalloc+0xa5/0x2a0
          Code: 00 00 4d 8b 07 65 4d 8b
          RSP: 0018:ffffaa1fc094bbe8 EFLAGS: 00010286
          RAX: 0000000000000000 RBX: d310a8800d7a3faf RCX: 0000000000000000
          RDX: 0000000000000000 RSI: 0000000000000dc0 RDI: ffff96e68fc036c0
          RBP: d310a8800d7a3faf R08: ffff96e6ffdb10a0 R09: 00000000752e7079
          R10: 000000000001c513 R11: 0000000004091041 R12: 0000000000000dc0
          R13: 0000000000000039 R14: ffff96e68fc036c0 R15: ffff96e68fc036c0
          FS:  00007f699dfba540(0000) GS:ffff96e6ffd80000(0000) knlGS:00000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 000055f3a9d9b768 CR3: 000000002cd1c000 CR4: 00000000000006e0
          Call Trace:
           ext4_htree_store_dirent+0x35/0x100 [ext4]
           htree_dirblock_to_tree+0xea/0x290 [ext4]
           ext4_htree_fill_tree+0x1c1/0x2d0 [ext4]
           ext4_readdir+0x67c/0x9d0 [ext4]
           iterate_dir+0x8d/0x1a0
           __x64_sys_getdents+0xab/0x130
           do_syscall_64+0x60/0x1f0
           entry_SYSCALL_64_after_hwframe+0x49/0xbe
          RIP: 0033:0x7f699d33a9fb
      
      This regression problem was introduced by commit e581595e ("ocfs: no
      need to check return value of debugfs_create functions").
      
      Link: http://lkml.kernel.org/r/20191225061501.13587-1-ghe@suse.com
      Fixes: e581595e ("ocfs: no need to check return value of debugfs_create functions")
      Signed-off-by: default avatarGang He <ghe@suse.com>
      Acked-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Changwei Ge <gechangwei@live.cn>
      Cc: Gang He <ghe@suse.com>
      Cc: Jun Piao <piaojun@huawei.com>
      Cc: <stable@vger.kernel.org>	[5.3+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b73eba2a
    • Kai Li's avatar
      ocfs2: call journal flush to mark journal as empty after journal recovery when mount · 397eac17
      Kai Li authored
      If journal is dirty when mount, it will be replayed but jbd2 sb log tail
      cannot be updated to mark a new start because journal->j_flag has
      already been set with JBD2_ABORT first in journal_init_common.
      
      When a new transaction is committed, it will be recored in block 1
      first(journal->j_tail is set to 1 in journal_reset).  If emergency
      restart happens again before journal super block is updated
      unfortunately, the new recorded trans will not be replayed in the next
      mount.
      
      The following steps describe this procedure in detail.
      1. mount and touch some files
      2. these transactions are committed to journal area but not checkpointed
      3. emergency restart
      4. mount again and its journals are replayed
      5. journal super block's first s_start is 1, but its s_seq is not updated
      6. touch a new file and its trans is committed but not checkpointed
      7. emergency restart again
      8. mount and journal is dirty, but trans committed in 6 will not be
      replayed.
      
      This exception happens easily when this lun is used by only one node.
      If it is used by multi-nodes, other node will replay its journal and its
      journal super block will be updated after recovery like what this patch
      does.
      
      ocfs2_recover_node->ocfs2_replay_journal.
      
      The following jbd2 journal can be generated by touching a new file after
      journal is replayed, and seq 15 is the first valid commit, but first seq
      is 13 in journal super block.
      
      logdump:
        Block 0: Journal Superblock
        Seq: 0   Type: 4 (JBD2_SUPERBLOCK_V2)
        Blocksize: 4096   Total Blocks: 32768   First Block: 1
        First Commit ID: 13   Start Log Blknum: 1
        Error: 0
        Feature Compat: 0
        Feature Incompat: 2 block64
        Feature RO compat: 0
        Journal UUID: 4ED3822C54294467A4F8E87D2BA4BC36
        FS Share Cnt: 1   Dynamic Superblk Blknum: 0
        Per Txn Block Limit    Journal: 0    Data: 0
      
        Block 1: Journal Commit Block
        Seq: 14   Type: 2 (JBD2_COMMIT_BLOCK)
      
        Block 2: Journal Descriptor
        Seq: 15   Type: 1 (JBD2_DESCRIPTOR_BLOCK)
        No. Blocknum        Flags
         0. 587             none
        UUID: 00000000000000000000000000000000
         1. 8257792         JBD2_FLAG_SAME_UUID
         2. 619             JBD2_FLAG_SAME_UUID
         3. 24772864        JBD2_FLAG_SAME_UUID
         4. 8257802         JBD2_FLAG_SAME_UUID
         5. 513             JBD2_FLAG_SAME_UUID JBD2_FLAG_LAST_TAG
        ...
        Block 7: Inode
        Inode: 8257802   Mode: 0640   Generation: 57157641 (0x3682809)
        FS Generation: 2839773110 (0xa9437fb6)
        CRC32: 00000000   ECC: 0000
        Type: Regular   Attr: 0x0   Flags: Valid
        Dynamic Features: (0x1) InlineData
        User: 0 (root)   Group: 0 (root)   Size: 7
        Links: 1   Clusters: 0
        ctime: 0x5de5d870 0x11104c61 -- Tue Dec  3 11:37:20.286280801 2019
        atime: 0x5de5d870 0x113181a1 -- Tue Dec  3 11:37:20.288457121 2019
        mtime: 0x5de5d870 0x11104c61 -- Tue Dec  3 11:37:20.286280801 2019
        dtime: 0x0 -- Thu Jan  1 08:00:00 1970
        ...
        Block 9: Journal Commit Block
        Seq: 15   Type: 2 (JBD2_COMMIT_BLOCK)
      
      The following is journal recovery log when recovering the upper jbd2
      journal when mount again.
      
      syslog:
        ocfs2: File system on device (252,1) was not unmounted cleanly, recovering it.
        fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 0
        fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 1
        fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 2
        fs/jbd2/recovery.c:(jbd2_journal_recover, 278): JBD2: recovery, exit status 0, recovered transactions 13 to 13
      
      Due to first commit seq 13 recorded in journal super is not consistent
      with the value recorded in block 1(seq is 14), journal recovery will be
      terminated before seq 15 even though it is an unbroken commit, inode
      8257802 is a new file and it will be lost.
      
      Link: http://lkml.kernel.org/r/20191217020140.2197-1-li.kai4@h3c.comSigned-off-by: default avatarKai Li <li.kai4@h3c.com>
      Reviewed-by: default avatarJoseph Qi <joseph.qi@linux.alibaba.com>
      Reviewed-by: default avatarChangwei Ge <gechangwei@live.cn>
      Cc: Mark Fasheh <mark@fasheh.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Junxiao Bi <junxiao.bi@oracle.com>
      Cc: Gang He <ghe@suse.com>
      Cc: Jun Piao <piaojun@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      397eac17