1. 06 Aug, 2017 6 commits
    • Miao Xie's avatar
      ext4: restructure ext4_expand_extra_isize · cf0a5e81
      Miao Xie authored
      Current ext4_expand_extra_isize just tries to expand extra isize, if
      someone is holding xattr lock or some check fails, it will give up.
      So rename its name to ext4_try_to_expand_extra_isize.
      
      Besides that, we clean up unnecessary check and move some relative checks
      into it.
      Signed-off-by: default avatarMiao Xie <miaoxie@huawei.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarWang Shilong <wshilong@ddn.com>
      cf0a5e81
    • Miao Xie's avatar
      ext4: fix forgetten xattr lock protection in ext4_expand_extra_isize · 3b10fdc6
      Miao Xie authored
      We should avoid the contention between the i_extra_isize update and
      the inline data insertion, so move the xattr trylock in front of
      i_extra_isize update.
      Signed-off-by: default avatarMiao Xie <miaoxie@huawei.com>
      Reviewed-by: default avatarWang Shilong <wshilong@ddn.com>
      3b10fdc6
    • Tahsin Erdogan's avatar
      ext4: make xattr inode reads faster · 9699d4f9
      Tahsin Erdogan authored
      ext4_xattr_inode_read() currently reads each block sequentially while
      waiting for io operation to complete before moving on to the next
      block. This prevents request merging in block layer.
      
      Add a ext4_bread_batch() function that starts reads for all blocks
      then optionally waits for them to complete. A similar logic is used
      in ext4_find_entry(), so update that code to use the new function.
      Signed-off-by: default avatarTahsin Erdogan <tahsin@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      9699d4f9
    • Tahsin Erdogan's avatar
      ext4: inplace xattr block update fails to deduplicate blocks · ec000220
      Tahsin Erdogan authored
      When an xattr block has a single reference, block is updated inplace
      and it is reinserted to the cache. Later, a cache lookup is performed
      to see whether an existing block has the same contents. This cache
      lookup will most of the time return the just inserted entry so
      deduplication is not achieved.
      
      Running the following test script will produce two xattr blocks which
      can be observed in "File ACL: " line of debugfs output:
      
        mke2fs -b 1024 -I 128 -F -O extent /dev/sdb 1G
        mount /dev/sdb /mnt/sdb
      
        touch /mnt/sdb/{x,y}
      
        setfattr -n user.1 -v aaa /mnt/sdb/x
        setfattr -n user.2 -v bbb /mnt/sdb/x
      
        setfattr -n user.1 -v aaa /mnt/sdb/y
        setfattr -n user.2 -v bbb /mnt/sdb/y
      
        debugfs -R 'stat x' /dev/sdb | cat
        debugfs -R 'stat y' /dev/sdb | cat
      
      This patch defers the reinsertion to the cache so that we can locate
      other blocks with the same contents.
      Signed-off-by: default avatarTahsin Erdogan <tahsin@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      ec000220
    • Tahsin Erdogan's avatar
      ext4: remove unused mode parameter · 77a2e84d
      Tahsin Erdogan authored
      ext4_alloc_file_blocks() does not use its mode parameter. Remove it.
      Signed-off-by: default avatarTahsin Erdogan <tahsin@google.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      77a2e84d
    • Arnd Bergmann's avatar
      ext4: fix warning about stack corruption · 2df2c340
      Arnd Bergmann authored
      After commit 62d1034f53e3 ("fortify: use WARN instead of BUG for now"),
      we get a warning about possible stack overflow from a memcpy that
      was not strictly bounded to the size of the local variable:
      
          inlined from 'ext4_mb_seq_groups_show' at fs/ext4/mballoc.c:2322:2:
      include/linux/string.h:309:9: error: '__builtin_memcpy': writing between 161 and 1116 bytes into a region of size 160 overflows the destination [-Werror=stringop-overflow=]
      
      We actually had a bug here that would have been found by the warning,
      but it was already fixed last year in commit 30a9d7af ("ext4: fix
      stack memory corruption with 64k block size").
      
      This replaces the fixed-length structure on the stack with a variable-length
      structure, using the correct upper bound that tells the compiler that
      everything is really fine here. I also change the loop count to check
      for the same upper bound for consistency, but the existing code is
      already correct here.
      
      Note that while clang won't allow certain kinds of variable-length arrays
      in structures, this particular instance is fine, as the array is at the
      end of the structure, and the size is strictly bounded.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      2df2c340
  2. 05 Aug, 2017 4 commits
    • Andreas Dilger's avatar
      ext4: fix dir_nlink behaviour · c7414892
      Andreas Dilger authored
      The dir_nlink feature has been enabled by default for new ext4
      filesystems since e2fsprogs-1.41 in 2008, and was automatically
      enabled by the kernel for older ext4 filesystems since the
      dir_nlink feature was added with ext4 in kernel 2.6.28+ when
      the subdirectory count exceeded EXT4_LINK_MAX-1.
      
      Automatically adding the file system features such as dir_nlink is
      generally frowned upon, since it could cause the file system to not be
      mountable on older kernel, thus preventing the administrator from
      rolling back to an older kernel if necessary.
      
      In this case, the administrator might also want to disable the feature
      because glibc's fts_read() function does not correctly optimize
      directory traversal for directories that use st_nlinks field of 1 to
      indicate that the number of links in the directory are not tracked by
      the file system, and could fail to traverse the full directory
      hierarchy.  Fortunately, in the past ten years very few users have
      complained about incomplete file system traversal by glibc's
      fts_read().
      
      This commit also changes ext4_inc_count() to allow i_nlinks to reach
      the full EXT4_LINK_MAX links on the parent directory (including "."
      and "..") before changing i_links_count to be 1.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=196405Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      c7414892
    • Dan Carpenter's avatar
      ext4: silence array overflow warning · 381cebfe
      Dan Carpenter authored
      I get a static checker warning:
      
          fs/ext4/ext4.h:3091 ext4_set_de_type()
          error: buffer overflow 'ext4_type_by_mode' 15 <= 15
      
      It seems unlikely that we would hit this read overflow in real life, but
      it's also simple enough to make the array 16 bytes instead of 15.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      381cebfe
    • Jan Kara's avatar
      ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize · fcf5ea10
      Jan Kara authored
      ext4_find_unwritten_pgoff() does not properly handle a situation when
      starting index is in the middle of a page and blocksize < pagesize. The
      following command shows the bug on filesystem with 1k blocksize:
      
        xfs_io -f -c "falloc 0 4k" \
                  -c "pwrite 1k 1k" \
                  -c "pwrite 3k 1k" \
                  -c "seek -a -r 0" foo
      
      In this example, neither lseek(fd, 1024, SEEK_HOLE) nor lseek(fd, 2048,
      SEEK_DATA) will return the correct result.
      
      Fix the problem by neglecting buffers in a page before starting offset.
      Reported-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      CC: stable@vger.kernel.org # 3.8+
      fcf5ea10
    • Daeho Jeong's avatar
      ext4: release discard bio after sending discard commands · e4510577
      Daeho Jeong authored
      We've changed the discard command handling into parallel manner.
      But, in this change, I forgot decreasing the usage count of the bio
      which was used to send discard request. I'm sorry about that.
      
      Fixes: a0154344 ("ext4: send parallel discards on commit completions")
      Signed-off-by: default avatarDaeho Jeong <daeho.jeong@samsung.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      e4510577
  3. 31 Jul, 2017 6 commits
  4. 30 Jul, 2017 5 commits
  5. 29 Jul, 2017 1 commit
  6. 28 Jul, 2017 18 commits
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-4.13-3' of git://git.linux-nfs.org/projects/anna/linux-nfs · 286ba844
      Linus Torvalds authored
      Pull NFS client fixes from Anna Schumaker:
       "More NFS client bugfixes for 4.13.
      
        Most of these fix locking bugs that Ben and Neil noticed, but I also
        have a patch to fix one more access bug that was reported after last
        week.
      
        Stable fixes:
         - Fix a race where CB_NOTIFY_LOCK fails to wake a waiter
         - Invalidate file size when taking a lock to prevent corruption
      
        Other fixes:
         - Don't excessively generate tiny writes with fallocate
         - Use the raw NFS access mask in nfs4_opendata_access()"
      
      * tag 'nfs-for-4.13-3' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails to wake a waiter
        NFS: Optimize fallocate by refreshing mapping when needed.
        NFS: invalidate file size when taking a lock.
        NFS: Use raw NFS access mask in nfs4_opendata_access()
      286ba844
    • Linus Torvalds's avatar
      Merge tag 'xfs-4.13-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 19993e73
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
      
       - fix firstfsb variables that we left uninitialized, which could lead
         to locking problems.
      
       - check for NULL metadata buffer pointers before using them.
      
       - don't allow btree cursor manipulation if the btree block is corrupt.
         Better to just shut down.
      
       - fix infinite loop problems in quotacheck.
      
       - fix buffer overrun when validating directory blocks.
      
       - fix deadlock problem in bunmapi.
      
      * tag 'xfs-4.13-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: fix multi-AG deadlock in xfs_bunmapi
        xfs: check that dir block entries don't off the end of the buffer
        xfs: fix quotacheck dquot id overflow infinite loop
        xfs: check _alloc_read_agf buffer pointer before using
        xfs: set firstfsb to NULLFSBLOCK before feeding it to _bmapi_write
        xfs: check _btree_check_block value
      19993e73
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 81554693
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "s390:
         - SRCU fix
      
        PPC:
         - host crash fixes
      
        x86:
         - bugfixes, including making nested posted interrupts really work
      
        Generic:
         - tweaks to kvm_stat and to uevents"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: LAPIC: Fix reentrancy issues with preempt notifiers
        tools/kvm_stat: add '-f help' to get the available event list
        tools/kvm_stat: use variables instead of hard paths in help output
        KVM: nVMX: Fix loss of L2's NMI blocking state
        KVM: nVMX: Fix posted intr delivery when vcpu is in guest mode
        x86: irq: Define a global vector for nested posted interrupts
        KVM: x86: do mask out upper bits of PAE CR3
        KVM: make pid available for uevents without debugfs
        KVM: s390: take srcu lock when getting/setting storage keys
        KVM: VMX: remove unused field
        KVM: PPC: Book3S HV: Fix host crash on changing HPT size
        KVM: PPC: Book3S HV: Enable TM before accessing TM registers
      81554693
    • Linus Torvalds's avatar
      Merge tag 'for-linus-4.13b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 8562e89e
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "Three minor cleanups for xen related drivers"
      
      * tag 'for-linus-4.13b-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: dont fiddle with event channel masking in suspend/resume
        xen: selfballoon: remove unnecessary static in frontswap_selfshrink()
        xen: Drop un-informative message during boot
      8562e89e
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 3d9d7405
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "I'd been collecting these whilst we debugged a CPU hotplug failure,
        but we ended up diagnosing that one to tglx, who has taken a fix via
        the -tip tree separately.
      
        We're seeing some NFS issues that we haven't gotten to the bottom of
        yet, and we've uncovered some issues with our backtracing too so there
        might be another fixes pull before we're done.
      
        Summary:
      
         - Ensure we have a guard page after the kernel image in vmalloc
      
         - Fix incorrect prefetch stride in copy_page
      
         - Ensure irqs are disabled in die()
      
         - Fix for event group validation in QCOM L2 PMU driver
      
         - Fix requesting of PMU IRQs on AMD Seattle
      
         - Minor cleanups and fixes"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: mmu: Place guard page after mapping of kernel image
        drivers/perf: arm_pmu: Request PMU SPIs with IRQF_PER_CPU
        arm64: sysreg: Fix unprotected macro argmuent in write_sysreg
        perf: qcom_l2: fix column exclusion check
        arm64/lib: copy_page: use consistent prefetch stride
        arm64/numa: Drop duplicate message
        perf: Convert to using %pOF instead of full_name
        arm64: Convert to using %pOF instead of full_name
        arm64: traps: disable irq in die()
        arm64: atomics: Remove '&' from '+&' asm constraint in lse atomics
        arm64: uaccess: Remove redundant __force from addr cast in __range_ok
      3d9d7405
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 080012ba
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "The highlight is Ben's patch to work around a host killing bug when
        running KVM guests with the Radix MMU on Power9. See the long change
        log of that commit for more detail.
      
        And then three fairly minor fixes:
      
         - fix of_node_put() underflow during reconfig remove, using old DLPAR
           tools.
      
         - fix recently introduced ld version check with 64-bit LE-only
           toolchain.
      
         - free the subpage_prot_table correctly, avoiding a memory leak.
      
        Thanks to: Aneesh Kumar K.V, Benjamin Herrenschmidt, Laurent Vivier"
      
      * tag 'powerpc-4.13-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/mm/hash: Free the subpage_prot_table correctly
        powerpc/Makefile: Fix ld version check with 64-bit LE-only toolchain
        powerpc/pseries: Fix of_node_put() underflow during reconfig remove
        powerpc/mm/radix: Workaround prefetch issue with KVM
      080012ba
    • Benjamin Coddington's avatar
      NFSv4.1: Fix a race where CB_NOTIFY_LOCK fails to wake a waiter · b7dbcc0e
      Benjamin Coddington authored
      nfs4_retry_setlk() sets the task's state to TASK_INTERRUPTIBLE within the
      same region protected by the wait_queue's lock after checking for a
      notification from CB_NOTIFY_LOCK callback.  However, after releasing that
      lock, a wakeup for that task may race in before the call to
      freezable_schedule_timeout_interruptible() and set TASK_WAKING, then
      freezable_schedule_timeout_interruptible() will set the state back to
      TASK_INTERRUPTIBLE before the task will sleep.  The result is that the task
      will sleep for the entire duration of the timeout.
      
      Since we've already set TASK_INTERRUPTIBLE in the locked section, just use
      freezable_schedule_timout() instead.
      
      Fixes: a1d617d8 ("nfs: allow blocking locks to be awoken by lock callbacks")
      Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
      Cc: stable@vger.kernel.org # v4.9+
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      b7dbcc0e
    • Linus Torvalds's avatar
      Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · e26f1bea
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - remove broken dt bindings in inside-secure
      
       - fix authencesn crash when used with digest_null
      
       - fix cavium/nitrox firmware path
      
       - fix SHA3 failure in brcm
      
       - fix Kconfig dependency for brcm
      
      * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: authencesn - Fix digest_null crash
        crypto: brcm - remove BCM_PDC_MBOX dependency in Kconfig
        Documentation/bindings: crypto: remove the dma-mask property
        crypto: inside-secure - do not parse the dma mask from dt
        crypto: cavium/nitrox - Change in firmware path.
        crypto: brcm - Fix SHA3-512 algorithm failure
      e26f1bea
    • Linus Torvalds's avatar
      Merge branch 'for-4.13-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 0a2a1330
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "Fixes addressing problems reported by users, and there's one more
        regression fix"
      
      * 'for-4.13-part3' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: round down size diff when shrinking/growing device
        Btrfs: fix early ENOSPC due to delalloc
        btrfs: fix lockup in find_free_extent with read-only block groups
        Btrfs: fix dir item validation when replaying xattr deletes
      0a2a1330
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md · 9583f1c9
      Linus Torvalds authored
      Pull MD fixes from Shaohua Li:
       "This fixes several bugs, three of them are marked for stable:
      
         - an initialization issue fixed by Ming
      
         - a bio clone race issue fixed by me
      
         - an async tx flush issue fixed by Ofer
      
         - other cleanups"
      
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md:
        MD: fix warnning for UP case
        md/raid5: add thread_group worker async_tx_issue_pending_all
        md: simplify code with bio_io_error
        md/raid1: fix writebehind bio clone
        md: raid1-10: move raid1/raid10 common code into raid1-10.c
        md: raid1/raid10: initialize bvec table via bio_add_page()
        md: remove 'idx' from 'struct resync_pages'
      9583f1c9
    • Linus Torvalds's avatar
      Merge tag 'for-4.13/dm-fixes' of... · 1731a474
      Linus Torvalds authored
      Merge tag 'for-4.13/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - a few DM integrity fixes that improve performance. One that address
         inefficiencies in the on-disk journal device layout. Another that
         makes use of the block layer's on-stack plugging when writing the
         journal.
      
       - a dm-bufio fix for the blk_status_t conversion that went in during
         the merge window.
      
       - a few DM raid fixes that address correctness when suspending the
         device and a validation fix for validation that occurs during device
         activation.
      
       - a couple DM zoned target fixes. Important one being the fix to not
         use GFP_KERNEL in the IO path due to concerns about deadlock in
         low-memory conditions (e.g. swap over a DM zoned device, etc).
      
       - a DM DAX device fix to make sure dm_dax_flush() is called if the
         underlying DAX device is operating as a write cache.
      
      * tag 'for-4.13/dm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm, dax: Make sure dm_dax_flush() is called if device supports it
        dm verity fec: fix GFP flags used with mempool_alloc()
        dm zoned: use GFP_NOIO in I/O path
        dm zoned: remove test for impossible REQ_OP_FLUSH conditions
        dm raid: bump target version
        dm raid: avoid mddev->suspended access
        dm raid: fix activation check in validate_raid_redundancy()
        dm raid: remove WARN_ON() in raid10_md_layout_to_format()
        dm bufio: fix error code in dm_bufio_write_dirty_buffers()
        dm integrity: test for corrupted disk format during table load
        dm integrity: WARN_ON if variables representing journal usage get out of sync
        dm integrity: use plugging when writing the journal
        dm integrity: fix inefficient allocation of journal space
      1731a474
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 0fa8dc42
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A small collection of fixes that should go into this series. This
        contains:
      
         - NVMe pull request from Christoph, with various fixes for nvme
           proper and nvme-fc.
      
         - disable runtime PM for blk-mq for now.
      
           With scsi now defaulting to using blk-mq, this reared its head as
           an issue. Longer term we'll fix up runtime PM for blk-mq, for now
           just disable it to prevent a hang on laptop resume for some folks.
      
         - blk-mq CPU <-> hw queue map fix from Christoph.
      
         - xen/blkfront pull request from Konrad, with two small fixes for the
           blkfront driver.
      
         - a few fixups for nbd from Joseph.
      
         - a stable fix for pblk from Javier"
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        lightnvm: pblk: advance bio according to lba index
        nvme: validate admin queue before unquiesce
        nbd: clear disconnected on reconnect
        nvme-pci: fix HMB size calculation
        nvme-fc: revise TRADDR parsing
        nvme-fc: address target disconnect race conditions in fcp io submit
        nvme: fabrics commands should use the fctype field for data direction
        nvme: also provide a UUID in the WWID sysfs attribute
        xen/blkfront: always allocate grants first from per-queue persistent grants
        xen-blkfront: fix mq start/stop race
        blk-mq: map queues to all present CPUs
        block: disable runtime-pm for blk-mq
        xen-blkfront: Fix handling of non-supported operations
        nbd: only set sndtimeo if we have a timeout set
        nbd: take tx_lock before disconnecting
        nbd: allow multiple disconnects to be sent
      0fa8dc42
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · a2d48756
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "Here are a couple of mmc fixes intended for v4.13-rc1.
      
        I have also included a couple of cleanup patches in this pull request
        for OMAP2+, related to the omap_hsmmc driver. The reason is because of
        the changes are also depending on OMAP SoC specific code, so this
        simplifies how to deal with this.
      
        Summary:
      
        MMC host:
         - sunxi: Correct time phase settings
         - omap_hsmmc: Clean up some dead code
         - dw_mmc: Fix message printed for deprecated num-slots DT binding
         - dw_mmc: Fix DT documentation"
      
      * tag 'mmc-v4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        Documentation: dw-mshc: deprecate num-slots
        mmc: dw_mmc: fix the wrong condition check of getting num-slots from DT
        mmc: host: omap_hsmmc: remove unused platform callbacks
        ARM: OMAP2+: hsmmc.c: Remove dead code
        mmc: sunxi: Keep default timing phase settings for new timing mode
      a2d48756
    • Javier González's avatar
      lightnvm: pblk: advance bio according to lba index · 75cb8e93
      Javier González authored
      When a lba either hits the cache or corresponds to an empty entry in the
      L2P table, we need to advance the bio according to the position in which
      the lba is located. Otherwise, we will copy data in the wrong page, thus
      causing data corruption for the application.
      
      In case of a cache hit, we assumed that bio->bi_iter.bi_idx would
      contain the correct index, but this is no necessarily true. Instead, use
      the local bio advance counter and iterator. This guarantees that lbas
      hitting the cache are copied into the right bv_page.
      
      In case of an empty L2P entry, we omitted to advance the bio. In the
      cases when the same I/O also contains a cache hit, data corresponding
      to this lba will be copied to the wrong bv_page. Fix this by advancing
      the bio as we do in the case of a cache hit.
      
      Fixes: a4bd217b lightnvm: physical block device (pblk) target
      Signed-off-by: default avatarJavier González <javier@javigon.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      75cb8e93
    • Will Deacon's avatar
      arm64: mmu: Place guard page after mapping of kernel image · 92bbd16e
      Will Deacon authored
      The vast majority of virtual allocations in the vmalloc region are followed
      by a guard page, which can help to avoid overruning on vma into another,
      which may map a read-sensitive device.
      
      This patch adds a guard page to the end of the kernel image mapping (i.e.
      following the data/bss segments).
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      92bbd16e
    • Matthias Kaehlcke's avatar
      x86/boot: Disable the address-of-packed-member compiler warning · 20c6c189
      Matthias Kaehlcke authored
      The clang warning 'address-of-packed-member' is disabled for the general
      kernel code, also disable it for the x86 boot code.
      
      This suppresses a bunch of warnings like this when building with clang:
      
      ./arch/x86/include/asm/processor.h:535:30: warning: taking address of
        packed member 'sp0' of class or structure 'x86_hw_tss' may result in an
        unaligned pointer value [-Waddress-of-packed-member]
          return this_cpu_read_stable(cpu_tss.x86_tss.sp0);
                                      ^~~~~~~~~~~~~~~~~~~
      ./arch/x86/include/asm/percpu.h:391:59: note: expanded from macro
        'this_cpu_read_stable'
          #define this_cpu_read_stable(var)       percpu_stable_op("mov", var)
                                                                          ^~~
      ./arch/x86/include/asm/percpu.h:228:16: note: expanded from macro
        'percpu_stable_op'
          : "p" (&(var)));
                   ^~~
      Signed-off-by: default avatarMatthias Kaehlcke <mka@chromium.org>
      Cc: Doug Anderson <dianders@chromium.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20170725215053.135586-1-mka@chromium.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      20c6c189
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.13-rc3' of git://people.freedesktop.org/~airlied/linux · 0b5477d9
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "These iare the fixes for 4.13-rc3: vmwgfx, exynos, i915, amdgpu,
        nouveau, host1x and displayport fixes.
      
        As expected people woke up this week, i915 didn't do an -rc2 pull so
        got a bumper -rc3 pull, and Ben resurfaced on nouveau and fixed a
        bunch of major crashers seen on Fedora 26, and there are a few vmwgfx
        fixes as well.
      
        Otherwise exynos had some regression fixes/cleanups, and amdgpu has an
        rcu locking regression fix and a couple of minor fixes"
      
      * tag 'drm-fixes-for-v4.13-rc3' of git://people.freedesktop.org/~airlied/linux: (44 commits)
        drm/i915: Fix bad comparison in skl_compute_plane_wm.
        drm/i915: Force CPU synchronisation even if userspace requests ASYNC
        drm/i915: Only skip updating execobject.offset after error
        drm/i915: Only mark the execobject as pinned on success
        drm/i915: Remove assertion from raw __i915_vma_unpin()
        drm/i915/cnl: Fix loadgen select programming on ddi vswing sequence
        drm/i915: Fix scaler init during CRTC HW state readout
        drm/i915/selftests: Fix an error handling path in 'mock_gem_device()'
        drm/i915: Unbreak gpu reset vs. modeset locking
        gpu: host1x: Free the IOMMU domain when there is no device to attach
        drm/i915: Fix cursor updates on some platforms
        drm/i915: Fix user ptr check size in eb_relocate_vma()
        drm: exynos: mark pm functions as __maybe_unused
        drm/exynos: select CEC_CORE if CEC_NOTIFIER
        drm/exynos/hdmi: fix disable sequence
        drm/exynos: mic: add a bridge at probe
        drm/exynos/dsi: Remove error handling for bridge_node DT parsing
        drm/exynos: dsi: do not try to find bridge
        drm: exynos: hdmi: make of_device_ids const.
        drm: exynos: constify mixer_match_types and *_mxr_drv_data.
        ...
      0b5477d9
    • Dave Airlie's avatar
      Merge tag 'exynos-drm-fixes-for-v4.13-rc3' of... · 20806588
      Dave Airlie authored
      Merge tag 'exynos-drm-fixes-for-v4.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
      
      Summary:
      - fix probing fail issue of dsi driver without bridge device.
      - fix disable sequence of hdmi driver.
      - trivial cleanups.
      
      * tag 'exynos-drm-fixes-for-v4.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
        drm: exynos: mark pm functions as __maybe_unused
        drm/exynos: select CEC_CORE if CEC_NOTIFIER
        drm/exynos/hdmi: fix disable sequence
        drm/exynos: mic: add a bridge at probe
        drm/exynos/dsi: Remove error handling for bridge_node DT parsing
        drm/exynos: dsi: do not try to find bridge
        drm: exynos: hdmi: make of_device_ids const.
        drm: exynos: constify mixer_match_types and *_mxr_drv_data.
        exynos_drm: Clean up duplicated assignment in exynos_drm_driver
      20806588