1. 25 Aug, 2017 1 commit
    • Bob Peterson's avatar
      GFS2: Withdraw for IO errors writing to the journal or statfs · 942b0cdd
      Bob Peterson authored
      Before this patch, if GFS2 encountered IO errors while writing to
      the journal, it would not report the problem, so they would go
      unnoticed, sometimes for many hours. Sometimes this would only be
      noticed later, when recovery tried to do journal replay and failed
      due to invalid metadata at the blocks that resulted in IO errors.
      
      This patch makes GFS2's log daemon check for IO errors. If it
      encounters one, it withdraws from the file system and reports
      why in dmesg. A similar action is taken when IO errors occur when
      writing to the system statfs file.
      
      These errors are also reported back to any callers of fsync, since
      that requires the journal to be flushed. Therefore, any IO errors
      that would previously go unnoticed are now noticed and the file
      system is withdrawn as early as possible, thus preventing further
      file system damage.
      
      Also note that this reintroduces superblock variable sd_log_error,
      which Christoph removed with commit f729b66f.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      942b0cdd
  2. 15 Aug, 2017 1 commit
    • Thomas Tai's avatar
      gfs2: fix slab corruption during mounting and umounting gfs file system · cc1dfa8b
      Thomas Tai authored
      When using cman-3.0.12.1 and gfs2-utils-3.0.12.1, mounting and
      unmounting GFS2 file system would cause kernel to hang. The slab
      allocator suggests that it is likely a double free memory corruption.
      The issue is traced back to v3.9-rc6 where a patch is submitted to
      use kzalloc() for storing a bitmap instead of using a local variable.
      The intention is to allocate memory during mount and to free memory
      during unmount. The original patch misses a code path which has
      already freed the memory and caused memory corruption. This patch sets
      the memory pointer to NULL after the memory is freed, so that double
      free memory corruption will not happen.
      
      gdlm_mount()
        '-- set_recover_size() which use kzalloc()
        '-- if dlm does not support ops callbacks then
                '--- free_recover_size() which use kfree()
      
      gldm_unmount()
        '-- free_recover_size() which use kfree()
      
      Previous patch which introduced the double free issue is
      commit 57c7310b ("GFS2: use kmalloc for lvb bitmap")
      Signed-off-by: default avatarThomas Tai <thomas.tai@oracle.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Reviewed-by: default avatarLiam R. Howlett <Liam.Howlett@Oracle.com>
      cc1dfa8b
  3. 10 Aug, 2017 6 commits
    • Abhi Das's avatar
      gfs2: forcibly flush ail to relieve memory pressure · b066a4ee
      Abhi Das authored
      On systems with low memory, it is possible for gfs2 to infinitely
      loop in balance_dirty_pages() under heavy IO (creating sparse files).
      
      balance_dirty_pages() attempts to write out the dirty pages via
      gfs2_writepages() but none are found because these dirty pages are
      being used by the journaling code in the ail. Normally, the journal
      has an upper threshold which when hit triggers an automatic flush
      of the ail. But this threshold can be higher than the number of
      allowable dirty pages and result in the ail never being flushed.
      
      This patch forces an ail flush when gfs2_writepages() fails to write
      anything. This is a good indication that the ail might be holding
      some dirty pages.
      Signed-off-by: default avatarAbhi Das <adas@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      b066a4ee
    • Andreas Gruenbacher's avatar
      gfs2: Clean up waiting on glocks · a91323e2
      Andreas Gruenbacher authored
      The prepare_to_wait_on_glock and finish_wait_on_glock functions introduced in
      commit 56a365be "gfs2: gfs2_glock_get: Wait on freeing glocks" are
      better removed, resulting in cleaner code.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      a91323e2
    • Andreas Gruenbacher's avatar
      gfs2: Defer deleting inodes under memory pressure · 6a1c8f6d
      Andreas Gruenbacher authored
      When under memory pressure and an inode's link count has dropped to
      zero, defer deleting the inode to the delete workqueue.  This avoids
      calling into DLM under memory pressure, which can deadlock.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      6a1c8f6d
    • Andreas Gruenbacher's avatar
      gfs2: gfs2_evict_inode: Put glocks asynchronously · 71c1b213
      Andreas Gruenbacher authored
      gfs2_evict_inode is called to free inodes under memory pressure.  The
      function calls into DLM when an inode's last cluster-wide reference goes
      away (remote unlink) and to release the glock and associated DLM lock
      before finally destroying the inode.  However, if DLM is blocked on
      memory to become available, calling into DLM again will deadlock.
      
      Avoid that by decoupling releasing glocks from destroying inodes in that
      case: with gfs2_glock_queue_put, glocks will be dequeued asynchronously
      in work queue context, when the associated inodes have likely already
      been destroyed.
      
      With this change, inodes can end up being unlinked, remote-unlink can be
      triggered, and then the inode can be reallocated before all
      remote-unlink callbacks are processed.  To detect that, revalidate the
      link count in gfs2_evict_inode to make sure we're not deleting an
      allocated, referenced inode.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      71c1b213
    • Andreas Gruenbacher's avatar
      gfs2: Get rid of gfs2_set_nlink · eebd2e81
      Andreas Gruenbacher authored
      Remove gfs2_set_nlink which prevents the link count of an inode from
      becoming non-zero once it has reached zero.  The next commit reduces the
      amount of waiting on glocks when an inode is evicted from memory.  With
      that, an inode can become reallocated before all the remote-unlink
      callbacks from a previous delete are processed, which causes the link
      count to change from zero to non-zero.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      eebd2e81
    • Andreas Gruenbacher's avatar
      gfs2: gfs2_glock_get: Wait on freeing glocks · 0515480a
      Andreas Gruenbacher authored
      Keep glocks in their hash table until they are freed instead of removing
      them when their last reference is dropped.  This allows to wait for any
      previous instances of a glock to go away in gfs2_glock_get before
      creating a new glocks.
      
      Special thanks to Andy Price for finding and fixing a problem which also
      required us to delete the rcu_read_unlock from the error case in function
      gfs2_glock_get.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      0515480a
  4. 09 Aug, 2017 6 commits
  5. 21 Jul, 2017 4 commits
    • Bob Peterson's avatar
      GFS2: Set gl_object in inode lookup only after block type check · 4d7c18c7
      Bob Peterson authored
      Before this patch, the inode glock's gl_object was set after a
      reference was acquired, but before the block type was verified.
      In cases where the block was unlinked, then freed and reused on
      another node, a residule delete callback (delete_work) would try
      to look up the inode, eventually failing the block check, but
      only after it overwrites gl_object with a pointer to the wrong
      inode. This patch moves the assignment of gl_object after the
      block check so it won't be improperly overwritten.
      
      Likewise, at the end of the function, gfs2_inode_lookup was
      clearing gl_object after it unlocked the glock, which meant
      another process might free the glock in the meantime. This
      patch guards against that case.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Reviewed-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      4d7c18c7
    • Bob Peterson's avatar
      GFS2: Introduce helper for clearing gl_object · df3d87bd
      Bob Peterson authored
      This patch introduces a new helper function in glock.h that
      clears gl_object, with an added integrity check. An additional
      integrity check has been added to glock_set_object, plus comments.
      This is step 1 in a series to ensure gl_object integrity.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Reviewed-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      df3d87bd
    • Coly Li's avatar
      gfs2: add flag REQ_PRIO for metadata I/O · e477b24b
      Coly Li authored
      When gfs2 does metadata I/O, only REQ_META is used as a metadata hint of
      the bio. But flag REQ_META is just a hint for block trace, not for block
      layer code to handle a bio as metadata request.
      
      For some of metadata I/Os of gfs2, A REQ_PRIO flag on the metadata bio
      would be very informative to block layer code. For example, if bcache is
      used as a I/O cache for gfs2, it will be possible for bcache code to get
      the hint and cache the pre-fetched metadata blocks on cache device. This
      behavior may be helpful to improve metadata I/O performance if the
      following requests hit the cache.
      
      Here are the locations in gfs2 code where a REQ_PRIO flag should be added,
      - All places where REQ_READAHEAD is used, gfs2 code uses this flag for
        metadata read ahead.
      - In gfs2_meta_rq() where the first metadata block is read in.
      - In gfs2_write_buf_to_page(), read in quota metadata blocks to have them
        up to date.
      These metadata blocks are probably to be accessed again in future, adding
      a REQ_PRIO flag may have bcache to keep such metadata in fast cache
      device. For system without a cache layer, REQ_PRIO can still provide hint
      to block layer to handle metadata requests more properly.
      Signed-off-by: default avatarColy Li <colyli@suse.de>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      e477b24b
    • Wang Xibo's avatar
      GFS2: fix code parameter error in inode_go_lock · e7cb550d
      Wang Xibo authored
      In inode_go_lock() function, the parameter order of list_add() is error.
      According to the define of list_add(), the first parameter is new entry
      and the second is the list head, so ip->i_trunc_list should be the
      first parameter and the sdp->sd_trunc_list should be second.
      
      Signed-off-by: Wang Xibo<wang.xibo@zte.com.cn>
      Signed-off-by: Xiao Likun<xiao.likun@zte.com.cn>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      e7cb550d
  6. 19 Jul, 2017 2 commits
    • Andreas Gruenbacher's avatar
      gfs2: Fixup to "Get rid of flush_delayed_work in gfs2_evict_inode" · 98e5a91a
      Andreas Gruenbacher authored
      When commit 4fd1a579 moved the call to flush_delayed_work from
      gfs2_evict_inode to gfs2_inode_lookup to avoid calling into DLM during
      evict, a similar call should have been added to gfs2_create_inode:
      that's another code path in which glocks of previous inodes may be
      reused.
      
      The flush of the iopen glock work queue added by 4fd1a579, on the
      other hand, is unnecessary and can be removed.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      98e5a91a
    • Jan Kara's avatar
      gfs2: Don't clear SGID when inheriting ACLs · 914cea93
      Jan Kara authored
      When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
      set, DIR1 is expected to have SGID bit set (and owning group equal to
      the owning group of 'DIR0'). However when 'DIR0' also has some default
      ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
      'DIR1' to get cleared if user is not member of the owning group.
      
      Fix the problem by moving posix_acl_update_mode() out of
      __gfs2_set_acl() into gfs2_set_acl(). That way the function will not be
      called when inheriting ACLs which is what we want as it prevents SGID
      bit clearing and the mode has been properly set by posix_acl_create()
      anyway.
      
      Fixes: 07393101Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      914cea93
  7. 17 Jul, 2017 2 commits
    • Andreas Gruenbacher's avatar
      gfs2: Lock holder cleanup (fixup) · 283c9a97
      Andreas Gruenbacher authored
      Function gfs2_holder_initialized should be used in do_flock as well.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      283c9a97
    • Bob Peterson's avatar
      GFS2: Prevent double brelse in gfs2_meta_indirect_buffer · 61eaadcd
      Bob Peterson authored
      Before this patch, problems reading in indirect buffers would send
      an IO error back to the caller, and release the buffer_head with
      brelse() in function gfs2_meta_indirect_buffer, however, it would
      still return the address of the buffer_head it released. After the
      error was discovered, function gfs2_block_map would call function
      release_metapath to free all buffers. That checked:
      if (mp->mp_bh[i] == NULL) but since the value was set after the
      error, it was non-zero, so brelse was called a second time. This
      resulted in the following error:
      
      kernel: WARNING: at fs/buffer.c:1224 __brelse+0x3a/0x40() (Tainted: G        W  -- ------------   )
      kernel: Hardware name: RHEV Hypervisor
      kernel: VFS: brelse: Trying to free free buffer
      
      This patch changes gfs2_meta_indirect_buffer so it only sets
      the buffer_head pointer in cases where it isn't released.
      Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
      Acked-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
      61eaadcd
  8. 08 Jul, 2017 6 commits
    • Kees Cook's avatar
      exec: Limit arg stack to at most 75% of _STK_LIM · da029c11
      Kees Cook authored
      To avoid pathological stack usage or the need to special-case setuid
      execs, just limit all arg stack usage to at most 75% of _STK_LIM (6MB).
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      da029c11
    • Linus Torvalds's avatar
      Merge tag 'for-linus-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux · 088737f4
      Linus Torvalds authored
      Pull Writeback error handling updates from Jeff Layton:
       "This pile represents the bulk of the writeback error handling fixes
        that I have for this cycle. Some of the earlier patches in this pile
        may look trivial but they are prerequisites for later patches in the
        series.
      
        The aim of this set is to improve how we track and report writeback
        errors to userland. Most applications that care about data integrity
        will periodically call fsync/fdatasync/msync to ensure that their
        writes have made it to the backing store.
      
        For a very long time, we have tracked writeback errors using two flags
        in the address_space: AS_EIO and AS_ENOSPC. Those flags are set when a
        writeback error occurs (via mapping_set_error) and are cleared as a
        side-effect of filemap_check_errors (as you noted yesterday). This
        model really sucks for userland.
      
        Only the first task to call fsync (or msync or fdatasync) will see the
        error. Any subsequent task calling fsync on a file will get back 0
        (unless another writeback error occurs in the interim). If I have
        several tasks writing to a file and calling fsync to ensure that their
        writes got stored, then I need to have them coordinate with one
        another. That's difficult enough, but in a world of containerized
        setups that coordination may even not be possible.
      
        But wait...it gets worse!
      
        The calls to filemap_check_errors can be buried pretty far down in the
        call stack, and there are internal callers of filemap_write_and_wait
        and the like that also end up clearing those errors. Many of those
        callers ignore the error return from that function or return it to
        userland at nonsensical times (e.g. truncate() or stat()). If I get
        back -EIO on a truncate, there is no reason to think that it was
        because some previous writeback failed, and a subsequent fsync() will
        (incorrectly) return 0.
      
        This pile aims to do three things:
      
         1) ensure that when a writeback error occurs that that error will be
            reported to userland on a subsequent fsync/fdatasync/msync call,
            regardless of what internal callers are doing
      
         2) report writeback errors on all file descriptions that were open at
            the time that the error occurred. This is a user-visible change,
            but I think most applications are written to assume this behavior
            anyway. Those that aren't are unlikely to be hurt by it.
      
         3) document what filesystems should do when there is a writeback
            error. Today, there is very little consistency between them, and a
            lot of cargo-cult copying. We need to make it very clear what
            filesystems should do in this situation.
      
        To achieve this, the set adds a new data type (errseq_t) and then
        builds new writeback error tracking infrastructure around that. Once
        all of that is in place, we change the filesystems to use the new
        infrastructure for reporting wb errors to userland.
      
        Note that this is just the initial foray into cleaning up this mess.
        There is a lot of work remaining here:
      
         1) convert the rest of the filesystems in a similar fashion. Once the
            initial set is in, then I think most other fs' will be fairly
            simple to convert. Hopefully most of those can in via individual
            filesystem trees.
      
         2) convert internal waiters on writeback to use errseq_t for
            detecting errors instead of relying on the AS_* flags. I have some
            draft patches for this for ext4, but they are not quite ready for
            prime time yet.
      
        This was a discussion topic this year at LSF/MM too. If you're
        interested in the gory details, LWN has some good articles about this:
      
            https://lwn.net/Articles/718734/
            https://lwn.net/Articles/724307/"
      
      * tag 'for-linus-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
        btrfs: minimal conversion to errseq_t writeback error reporting on fsync
        xfs: minimal conversion to errseq_t writeback error reporting
        ext4: use errseq_t based error handling for reporting data writeback errors
        fs: convert __generic_file_fsync to use errseq_t based reporting
        block: convert to errseq_t based writeback error tracking
        dax: set errors in mapping when writeback fails
        Documentation: flesh out the section in vfs.txt on storing and reporting writeback errors
        mm: set both AS_EIO/AS_ENOSPC and errseq_t in mapping_set_error
        fs: new infrastructure for writeback error handling and reporting
        lib: add errseq_t type and infrastructure for handling it
        mm: don't TestClearPageError in __filemap_fdatawait_range
        mm: clear AS_EIO/AS_ENOSPC when writeback initiation fails
        jbd2: don't clear and reset errors after waiting on writeback
        buffer: set errors in mapping at the time that the error occurs
        fs: check for writeback errors after syncing out buffers in generic_file_fsync
        buffer: use mapping_set_error instead of setting the flag
        mm: fix mapping_set_error call in me_pagecache_dirty
      088737f4
    • Linus Torvalds's avatar
      Merge tag 'for-linus-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux · 33198c16
      Linus Torvalds authored
      Pull Writeback error handling fixes from Jeff Layton:
       "The main rationale for all of these changes is to tighten up writeback
        error reporting to userland. There are many ways now that writeback
        errors can be lost, such that fsync/fdatasync/msync return 0 when
        writeback actually failed.
      
        This pile contains a small set of cleanups and writeback error
        handling fixes that I was able to break off from the main pile (#2).
      
        Two of the patches in this pile are trivial. The exceptions are the
        patch to fix up error handling in write_one_page, and the patch to
        make JFS pay attention to write_one_page errors"
      
      * tag 'for-linus-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
        fs: remove call_fsync helper function
        mm: clean up error handling in write_one_page
        JFS: do not ignore return code from write_one_page()
        mm: drop "wait" parameter from write_one_page()
      33198c16
    • Linus Torvalds's avatar
      Merge tag 'cifs-bug-fixes-for-4.13' of git://git.samba.org/sfrench/cifs-2.6 · 3ea4fcc5
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "First set of CIFS/SMB3 fixes for the merge window. Also improves POSIX
        character mapping for SMB3"
      
      * tag 'cifs-bug-fixes-for-4.13' of git://git.samba.org/sfrench/cifs-2.6:
        CIFS: fix circular locking dependency
        cifs: set oparms.create_options rather than or'ing in CREATE_OPEN_BACKUP_INTENT
        cifs: Do not modify mid entry after submitting I/O in cifs_call_async
        CIFS: add SFM mapping for 0x01-0x1F
        cifs: hide unused functions
        cifs: Use smb 2 - 3 and cifsacl mount options getacl functions
        cifs: prototype declaration and definition for smb 2 - 3 and cifsacl mount options
        CIFS: add CONFIG_CIFS_DEBUG_KEYS to dump encryption keys
        cifs: set mapping error when page writeback fails in writepage or launder_pages
        SMB3: Enable encryption for SMB3.1.1
      3ea4fcc5
    • Linus Torvalds's avatar
      Merge tag 'gfs2-4.13.fixes.addendum' of... · 1a86fc75
      Linus Torvalds authored
      Merge tag 'gfs2-4.13.fixes.addendum' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2
      
      Pull GFS2 fix from Bob Peterson:
       "Sorry for the additional merge request, but Andreas discovered this
        problem soon after you processed our last gfs2 merge.
      
        This fixes a regression introduced by a patch we did in mid-2015
        (commit 88ffbf3e: "GFS2: Use resizable hash table for glocks"), so
        best to get it fixed. Some code was reverted that should not have
        been.
      
        The patch from Andreas Gruenbacher just re-adds code that had been
        there originally"
      
      * tag 'gfs2-4.13.fixes.addendum' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Fix glock rhashtable rcu bug
      1a86fc75
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · a7d40268
      Linus Torvalds authored
      Pull security layer fixes from James Morris:
       "Bugfixes for TPM and SELinux"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        IB/core: Fix static analysis warning in ib_policy_change_task
        IB/core: Fix uninitialized variable use in check_qp_port_pkey_settings
        tpm: do not suspend/resume if power stays on
        tpm: use tpm2_pcr_read() in tpm2_do_selftest()
        tpm: use tpm_buf functions in tpm2_pcr_read()
        tpm_tis: make ilb_base_addr static
        tpm: consolidate the TPM startup code
        tpm: Enable CLKRUN protocol for Braswell systems
        tpm/tpm_crb: fix priv->cmd_size initialisation
        tpm: fix a kernel memory leak in tpm-sysfs.c
        tpm: Issue a TPM2_Shutdown for TPM2 devices.
        Add "shutdown" to "struct class".
      a7d40268
  9. 07 Jul, 2017 12 commits
    • Linus Torvalds's avatar
      Merge tag 'kbuild-thinar-v4.13' of... · 98ced886
      Linus Torvalds authored
      Merge tag 'kbuild-thinar-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild thin archives updates from Masahiro Yamada:
       "Thin archives migration by Nicholas Piggin.
      
        THIN_ARCHIVES has been available for a while as an optional feature
        only for PowerPC architecture, but we do not need two different
        intermediate-artifact schemes.
      
        Using thin archives instead of conventional incremental linking has
        various advantages:
      
         - save disk space for builds
      
         - speed-up building a little
      
         - fix some link issues (for example, allyesconfig on ARM) due to more
           flexibility for the final linking
      
         - work better with dead code elimination we are planning
      
        As discussed before, this migration has been done unconditionally so
        that any problems caused by this will show up with "git bisect".
      
        With testing with 0-day and linux-next, some architectures actually
        showed up problems, but they were trivial and all fixed now"
      
      * tag 'kbuild-thinar-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        tile: remove unneeded extra-y in Makefile
        kbuild: thin archives make default for all archs
        x86/um: thin archives build fix
        tile: thin archives fix linking
        ia64: thin archives fix linking
        sh: thin archives fix linking
        kbuild: handle libs-y archives separately from built-in.o archives
        kbuild: thin archives use P option to ar
        kbuild: thin archives final link close --whole-archives option
        ia64: remove unneeded extra-y in Makefile.gate
        tile: fix dependency and .*.cmd inclusion for incremental build
        sparc64: Use indirect calls in hamming weight stubs
      98ced886
    • Linus Torvalds's avatar
      Merge tag 'kbuild-misc-v4.13' of... · 16ffc4c3
      Linus Torvalds authored
      Merge tag 'kbuild-misc-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull misc Kbuild updates from Masahiro Yamada:
      
       - Use more portable shebang for Perl scripts
      
       - Remove trailing spaces from GCC version in kernel log
      
       - Make initramfs generation deterministic
      
      * tag 'kbuild-misc-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: create deterministic initramfs directory listings
        scripts/mkcompile_h: Remove trailing spaces from compiler version
        scripts: Switch to more portable Perl shebang
      16ffc4c3
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · 58f051fc
      Linus Torvalds authored
      Pull Kbuild updates from Masahiro Yamada:
      
       - Clean up Makefiles and scripts
      
       - Improve clang support
      
       - Remove unneeded genhdr-y syntax
      
       - Remove unneeded cc-option-align macro
      
       - Introduce __cc-option macro and use it to fix x86 boot code compiler
         flags
      
      * tag 'kbuild-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: improve comments on KBUILD_SRC
        x86/build: Specify stack alignment for clang
        x86/build: Use __cc-option for boot code compiler options
        kbuild: Add __cc-option macro
        kbuild: remove cc-option-align
        kbuild: replace genhdr-y with generated-y
        kbuild: clang: Disable 'address-of-packed-member' warning
        kbuild: remove duplicated arch/*/include/generated/uapi include path
        kbuild: speed up checksyscalls.sh
        kbuild: simplify silent build (-s) detection
      58f051fc
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-4.13-rc1-update' of... · ef3ad089
      Linus Torvalds authored
      Merge tag 'linux-kselftest-4.13-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest updates from Shuah Khan:
       "This update consists of:
      
         - TAP13 framework and changes to some tests to convert to TAP13.
           Converting kselftest output to standard format will help identify
           run to run differences and pin point failures easily. TAP13 format
           has been in use for several years and the output is human friendly.
      
           Please find the specification:
             https://testanything.org/tap-version-13-specification.html
      
           Credit goes to Tim Bird for recommending TAP13 as a suitable
           format, and to Grag KH for kick starting the work with help from
           Paul Elder and Alice Ferrazzi
      
           The first phase of the TAp13 conversion is included in this update.
           Future updates will include updates to rest of the tests.
      
         - Masami Hiramatsu fixed ftrace to run on 4.9 stable kernels.
      
         - Kselftest documnetation has been converted to ReST format. Document
           now has a new home under Documentation/dev-tools.
      
         - kselftest_harness.h is now available for general use as a result of
           Mickaël Salaün's work.
      
         - Several fixes to skip and/or fail tests gracefully on older
           releases"
      
      * tag 'linux-kselftest-4.13-rc1-update' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (48 commits)
        selftests: membarrier: use ksft_* var arg msg api
        selftests: breakpoints: breakpoint_test_arm64: convert test to use TAP13
        selftests: breakpoints: step_after_suspend_test use ksft_* var arg msg api
        selftests: breakpoint_test: use ksft_* var arg msg api
        kselftest: add ksft_print_msg() function to output general information
        kselftest: make ksft_* output functions variadic
        selftests/capabilities: Fix the test_execve test
        selftests: intel_pstate: add .gitignore
        selftests: fix memory-hotplug test
        selftests: add missing test name in memory-hotplug test
        selftests: check percentage range for memory-hotplug test
        selftests: check hot-pluggagble memory for memory-hotplug test
        selftests: typo correction for memory-hotplug test
        selftests: ftrace: Use md5sum to take less time of checking logs
        tools/testing/selftests/sysctl: Add pre-check to the value of writes_strict
        kselftest.rst: do some adjustments after ReST conversion
        selftest/net/Makefile: Specify output with $(OUTPUT)
        selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS
        selftest/memfd/Makefile: Fix build error
        selftests: lib: Skip tests on missing test modules
        ...
      ef3ad089
    • Linus Torvalds's avatar
      Merge tag 'openrisc-for-linus' of git://github.com/openrisc/linux · 37949075
      Linus Torvalds authored
      Pull OpenRISC updates from Stafford Horne:
       "Openrisc fixes for this 4.13 merge window, there is not really much
        here:
      
         - include cleanups, one with should reduce build time slightly
      
         - switch to new toolchain to new (>2 year old) toolchain prefix"
      
      * tag 'openrisc-for-linus' of git://github.com/openrisc/linux:
        openrisc: defconfig: Cleanup from old Kconfig options
        openrisc: explicitly include linux/bug.h in asm/fixmap.h
        openrisc: Switch to use export.h instead of module.h
        openrisc: Change toolchain from or32- to or1k-
      37949075
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · d691b7e7
      Linus Torvalds authored
      Pull powerpc updates from Michael Ellerman:
       "Highlights include:
      
         - Support for STRICT_KERNEL_RWX on 64-bit server CPUs.
      
         - Platform support for FSP2 (476fpe) board
      
         - Enable ZONE_DEVICE on 64-bit server CPUs.
      
         - Generic & powerpc spin loop primitives to optimise busy waiting
      
         - Convert VDSO update function to use new update_vsyscall() interface
      
         - Optimisations to hypercall/syscall/context-switch paths
      
         - Improvements to the CPU idle code on Power8 and Power9.
      
        As well as many other fixes and improvements.
      
        Thanks to: Akshay Adiga, Andrew Donnellan, Andrew Jeffery, Anshuman
        Khandual, Anton Blanchard, Balbir Singh, Benjamin Herrenschmidt,
        Christophe Leroy, Christophe Lombard, Colin Ian King, Dan Carpenter,
        Gautham R. Shenoy, Hari Bathini, Ian Munsie, Ivan Mikhaylov, Javier
        Martinez Canillas, Madhavan Srinivasan, Masahiro Yamada, Matt Brown,
        Michael Neuling, Michal Suchanek, Murilo Opsfelder Araujo, Naveen N.
        Rao, Nicholas Piggin, Oliver O'Halloran, Paul Mackerras, Pavel Machek,
        Russell Currey, Santosh Sivaraj, Stephen Rothwell, Thiago Jung
        Bauermann, Yang Li"
      
      * tag 'powerpc-4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (158 commits)
        powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs
        powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix
        powerpc/mm/hash: Implement mark_rodata_ro() for hash
        powerpc/vmlinux.lds: Align __init_begin to 16M
        powerpc/lib/code-patching: Use alternate map for patch_instruction()
        powerpc/xmon: Add patch_instruction() support for xmon
        powerpc/kprobes/optprobes: Use patch_instruction()
        powerpc/kprobes: Move kprobes over to patch_instruction()
        powerpc/mm/radix: Fix execute permissions for interrupt_vectors
        powerpc/pseries: Fix passing of pp0 in updatepp() and updateboltedpp()
        powerpc/64s: Blacklist rtas entry/exit from kprobes
        powerpc/64s: Blacklist functions invoked on a trap
        powerpc/64s: Un-blacklist system_call() from kprobes
        powerpc/64s: Move system_call() symbol to just after setting MSR_EE
        powerpc/64s: Blacklist system_call() and system_call_common() from kprobes
        powerpc/64s: Convert .L__replay_interrupt_return to a local label
        powerpc64/elfv1: Only dereference function descriptor for non-text symbols
        cxl: Export library to support IBM XSL
        powerpc/dts: Use #include "..." to include local DT
        powerpc/perf/hv-24x7: Aggregate result elements on POWER9 SMT8
        ...
      d691b7e7
    • Linus Torvalds's avatar
      vfs: fix flock compat thinko · b59eea55
      Linus Torvalds authored
      Michael Ellerman reported that commit 8c6657cb ("Switch flock
      copyin/copyout primitives to copy_{from,to}_user()") broke his
      networking on a bunch of PPC machines (64-bit kernel, 32-bit userspace).
      
      The reason is a brown-paper bug by that commit, which had the arguments
      to "copy_flock_fields()" in the wrong order, breaking the compat
      handling for file locking.  Apparently very few people run 32-bit user
      space on x86 any more, so the PPC people got the honor of noticing this
      "feature".
      
      Michael also sent a minimal diff that just changed the order of the
      arguments in that macro.
      
      This is not that minimal diff.
      
      This not only changes the order of the arguments in the macro, it also
      changes them to be pointers (to be consistent with all the other uses of
      those pointers), and makes the functions that do all of this also have
      the proper "const" attribution on the source pointers in order to make
      issues like that (using the source as a destination) be really obvious.
      Reported-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b59eea55
    • Linus Torvalds's avatar
      Merge tag 'usb-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 64813520
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some remaining USB fixes for 4.13-rc1. They were originally
        scheduled for 4.12-final, but I didn't send them to you in time.
        Because of that, they were in a separate branch from the larger USB
        set of patches, so here they are in a separate pull request.
      
        Nothing major here a all, just three small patches:
      
         - some usb-serial new device ids
         - xhci bugfix for some crazy AMD hardware
      
        All of these have been in linux-next for a long time with no reported
        issues"
      
      * tag 'usb-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        xhci: Limit USB2 port wake support for AMD Promontory hosts
        USB: serial: qcserial: new Sierra Wireless EM7305 device ID
        USB: serial: option: add two Longcheer device ids
      64813520
    • Linus Torvalds's avatar
      Merge tag 'backlight-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight · df7cb187
      Linus Torvalds authored
      Pull backlight updates from Lee Jones:
       "Core Framework:
         - Report correct error status to user
      
        Fix-ups:
         - Move Backlight headers out of I2C (adp8860, adp8870)"
      
      * tag 'backlight-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
        video: adp8870: move header file out of I2C realm
        backlight: adp8860: Move header file out of I2C realm
        backlight: Report error on failure
      df7cb187
    • Linus Torvalds's avatar
      Merge (most of) tag 'mfd-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · 6972b007
      Linus Torvalds authored
      Pull MFD updates from Lee Jones:
       "New Drivers:
         - Intel Cherry Trail Whiskey Cove PMIC
         - TI LP87565 PMIC
      
        New Device Support:
         - Add support for Cannonlake to intel-lpss-pci
         - Add support for Simatic IOT2000 to intel_quark_i2c_gpio
      
        New Functionality:
         - Add Regulator support (axp20x)
      
        Fix-ups:
         - Rework IRQ handling (intel_soc_pmic_bxtwc, rtsx_pcr, cros_ec)
         - Remove unused/unwelcome code (ipaq-micro, wm831x-core, da9062-core)
         - Provide deregistration on unbind (rn5t618)
         - Rework DT code/documentation (arizona)
         - Constify things (fsl-imx25-tsadc)
         - MAINTAINERS updates (DA9062/61)
         - Kconfig configuration adaptions (INTEL_SOC_PMIC, MFD_AXP20X_I2C)
         - Switch to DMI matching (intel_quark_i2c_gpio)
         - Provide an appropriate level of error checking (wm831x-{i2c,spi},
           twl4030-irq, tc6393xb)
         - Make use of devm_* (resource handling) calls (intel_soc_pmic_bxtwc,
           stm32-timers, atmel-flexcom, cros_ec, fsl-imx25-tsadc,
           exynos-lpass, palmas, qcom-spmi-pmic, smsc-ece1099,
           motorola-cpcap)"
      
      [ Skipped the last commit in that series that added eight thousand
        lines of pointless repeated register definitions.  - Linus ]
      
      * tag 'mfd-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (38 commits)
        mfd: Add LP87565 PMIC support
        mfd: cros_ec: Free IRQ on exit
        dt-bindings: vendor-prefixes: Add arctic to vendor prefix
        mfd: da9061: Fix to remove BBAT_CONT register from chip model
        mfd: da9061: Fix to remove BBAT_CONT register from chip model
        mfd: axp20x-i2c: Document that this must be builtin on x86
        mfd: Add Cherry Trail Whiskey Cove PMIC driver
        mfd: tc6393xb: Handle return value of clk_prepare_enable
        mfd: intel_quark_i2c_gpio: Add support for SIMATIC IOT2000 platform
        mfd: intel_quark_i2c_gpio: Use dmi_system_id table for retrieving frequency
        mfd: motorola-cpcap: Use devm_of_platform_populate()
        mfd: smsc-ece: Use devm_of_platform_populate()
        mfd: qcom-spmi-pmic: Use devm_of_platform_populate()
        mfd: palmas: Use devm_of_platform_populate()
        mfd: exynos: Use devm_of_platform_populate()
        mfd: fsl-imx25: Use devm_of_platform_populate()
        mfd: cros_ec: Use devm_of_platform_populate()
        mfd: atmel: Use devm_of_platform_populate()
        mfd: stm32-timers: Use devm_of_platform_populate()
        mfd: intel_soc_pmic: Select designware i2c-bus driver
        ...
      6972b007
    • Linus Torvalds's avatar
      Merge tag 'gpio-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · c7d28eca
      Linus Torvalds authored
      Pull GPIO updates from Linus Walleij:
       "This is the bulk of GPIO changes for the v4.13 series.
      
        Some administrativa:
      
        I have a slew of 8250 serial patches and the new IOT2040 serial+GPIO
        driver coming in through this tree, along with a whole bunch of Exar
        8250 fixes. These are ACKed by Greg and also hit drivers/platform/*
        where they are ACKed by Andy Shevchenko.
      
        Speaking about drivers/platform/* there is also a bunch of ACPI stuff
        coming through that route, again ACKed by Andy.
      
        The MCP23S08 changes are coming in here as well. You already have the
        commits in your tree, so this is just a result of sharing an immutable
        branch between pin control and GPIO.
      
        Core:
         - Export add/remove for lookup tables so that modules can export GPIO
           descriptor tables.
         - Handle GPIO sleep states: it is now possible to flag that a GPIO
           line may loose its state during suspend/resume of the system to
           save power. This is used in the Wolfson Micro Arizona driver.
         - ACPI-based GPIO was tightened up a lot around the edges.
         - Use bitmap_fill() to speed up a loop.
      
        New drivers:
         - Exar XRA1403 SPI-based GPIO.
         - MVEBU driver now supports Armada 7K and 8K.
         - LP87565 PMIC GPIO.
         - Renesas R-CAR R8A7743 (RZ/G1M).
         - The new IOT2040 8250 serial/GPIO also comes in through this
           changeset.
      
        Substantial driver changes:
         - Seriously fix the Exar 8250 GPIO portions to work.
         - The MCP23S08 was moved out to a pin control driver.
         - Convert MEVEBU to use regmap for register access.
         - Drop Vulcan support from the Broadcom driver.
         - Serious cleanup and improvement of the mockup driver, giving us a
           better test coverage.
      
        Misc:
         - Lots of janitorial clean up.
         - A bunch of documentation fixes"
      
      * tag 'gpio-v4.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (70 commits)
        serial: exar: Add support for IOT2040 device
        gpio-exar/8250-exar: Make set of exported GPIOs configurable
        platform: Accept const properties
        serial: exar: Factor out platform hooks
        gpio-exar/8250-exar: Rearrange gpiochip parenthood
        gpio: exar: Fix iomap request
        gpio-exar/8250-exar: Do not even instantiate a GPIO device for Commtech cards
        serial: uapi: Add support for bus termination
        gpio: rcar: Add R8A7743 (RZ/G1M) support
        gpio: gpio-wcove: Fix GPIO control register offset calculation
        gpio: lp87565: Add support for GPIO
        gpio: dwapb: fix missing first irq for edgeboth irq type
        MAINTAINERS: Take maintainership for GPIO ACPI support
        gpio: exar: Fix reading of directions and values
        gpio: exar: Allocate resources on behalf of the platform device
        gpio-exar/8250-exar: Fix passing in of parent PCI device
        gpio: mockup: use devm_kcalloc() where applicable
        gpio: mockup: add myself as author
        gpio: mockup: improve the error message
        gpio: mockup: don't return magic numbers from probe()
        ...
      c7d28eca
    • Krzysztof Kozlowski's avatar
      openrisc: defconfig: Cleanup from old Kconfig options · 2e08a0ef
      Krzysztof Kozlowski authored
      Remove old, dead Kconfig option INET_LRO. It is gone since
      commit 7bbf3cae ("ipv4: Remove inet_lro library").
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarStafford Horne <shorne@gmail.com>
      2e08a0ef