Merge branch 'akpm' (patches from Andrew)
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 Jun 2018 23:51:42 +0000 (08:51 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 Jun 2018 23:51:42 +0000 (08:51 +0900)
Merge more updates from Andrew Morton:

 - MM remainders

 - various misc things

 - kcov updates

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (27 commits)
  lib/test_printf.c: call wait_for_random_bytes() before plain %p tests
  hexagon: drop the unused variable zero_page_mask
  hexagon: fix printk format warning in setup.c
  mm: fix oom_kill event handling
  treewide: use PHYS_ADDR_MAX to avoid type casting ULLONG_MAX
  mm: use octal not symbolic permissions
  ipc: use new return type vm_fault_t
  sysvipc/sem: mitigate semnum index against spectre v1
  fault-injection: reorder config entries
  arm: port KCOV to arm
  sched/core / kcov: avoid kcov_area during task switch
  kcov: prefault the kcov_area
  kcov: ensure irq code sees a valid area
  kernel/relay.c: change return type to vm_fault_t
  exofs: avoid VLA in structures
  coredump: fix spam with zero VMA process
  fat: use fat_fs_error() instead of BUG_ON() in __fat_get_block()
  proc: skip branch in /proc/*/* lookup
  mremap: remove LATENCY_LIMIT from mremap to reduce the number of TLB shootdowns
  mm/memblock: add missing include <linux/bootmem.h>
  ...

1  2 
arch/arm/Kconfig
fs/fat/inode.c

diff --combined arch/arm/Kconfig
index 0be4397f3ccc17d1fd0298d051ce5e10d92eacb2,47eb26dc242726cfa9d05621338b28be5a7042b4..483d2858e3677ec7d983a87e965e781cc4f28b3f
@@@ -8,9 -8,10 +8,10 @@@ config AR
        select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_FORTIFY_SOURCE
+       select ARCH_HAS_KCOV
        select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
-       select ARCH_HAS_SET_MEMORY
        select ARCH_HAS_PHYS_TO_DMA
+       select ARCH_HAS_SET_MEMORY
        select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
        select ARCH_HAS_STRICT_MODULE_RWX if MMU
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
@@@ -57,6 -58,7 +58,6 @@@
        select HAVE_ARCH_TRACEHOOK
        select HAVE_ARM_SMCCC if CPU_V7
        select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
 -      select HAVE_CC_STACKPROTECTOR
        select HAVE_CONTEXT_TRACKING
        select HAVE_C_RECORDMCOUNT
        select HAVE_DEBUG_KMEMLEAK
@@@ -91,7 -93,6 +92,7 @@@
        select HAVE_RCU_TABLE_FREE if (SMP && ARM_LPAE)
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_RSEQ
 +      select HAVE_STACKPROTECTOR
        select HAVE_SYSCALL_TRACEPOINTS
        select HAVE_UID16
        select HAVE_VIRT_CPU_ACCOUNTING_GEN
diff --combined fs/fat/inode.c
index 13271ea2b4532871c8e740752aec2f7c305aebca,4f818f7fa155e6407d788bf7f18b45d300a96231..065dc919a0ce15963b21265f4872b007bcfc3310
@@@ -158,8 -158,14 +158,14 @@@ static inline int __fat_get_block(struc
        err = fat_bmap(inode, iblock, &phys, &mapped_blocks, create, false);
        if (err)
                return err;
+       if (!phys) {
+               fat_fs_error(sb,
+                            "invalid FAT chain (i_pos %lld, last_block %llu)",
+                            MSDOS_I(inode)->i_pos,
+                            (unsigned long long)last_block);
+               return -EIO;
+       }
  
-       BUG_ON(!phys);
        BUG_ON(*max_blocks != mapped_blocks);
        set_buffer_new(bh_result);
        map_bh(bh_result, sb, phys);
@@@ -502,7 -508,6 +508,7 @@@ static int fat_validate_dir(struct inod
  /* doesn't deal with root inode */
  int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
  {
 +      struct timespec ts;
        struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
        int error;
  
        inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1))
                           & ~((loff_t)sbi->cluster_size - 1)) >> 9;
  
 -      fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0);
 +      fat_time_fat2unix(sbi, &ts, de->time, de->date, 0);
 +      inode->i_mtime = timespec_to_timespec64(ts);
        if (sbi->options.isvfat) {
 -              fat_time_fat2unix(sbi, &inode->i_ctime, de->ctime,
 +              fat_time_fat2unix(sbi, &ts, de->ctime,
                                  de->cdate, de->ctime_cs);
 -              fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0);
 +              inode->i_ctime = timespec_to_timespec64(ts);
 +              fat_time_fat2unix(sbi, &ts, 0, de->adate, 0);
 +              inode->i_atime = timespec_to_timespec64(ts);
        } else
                inode->i_ctime = inode->i_atime = inode->i_mtime;
  
@@@ -829,7 -831,6 +835,7 @@@ static int fat_statfs(struct dentry *de
  
  static int __fat_write_inode(struct inode *inode, int wait)
  {
 +      struct timespec ts;
        struct super_block *sb = inode->i_sb;
        struct msdos_sb_info *sbi = MSDOS_SB(sb);
        struct buffer_head *bh;
@@@ -867,16 -868,13 +873,16 @@@ retry
                raw_entry->size = cpu_to_le32(inode->i_size);
        raw_entry->attr = fat_make_attrs(inode);
        fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart);
 -      fat_time_unix2fat(sbi, &inode->i_mtime, &raw_entry->time,
 +      ts = timespec64_to_timespec(inode->i_mtime);
 +      fat_time_unix2fat(sbi, &ts, &raw_entry->time,
                          &raw_entry->date, NULL);
        if (sbi->options.isvfat) {
                __le16 atime;
 -              fat_time_unix2fat(sbi, &inode->i_ctime, &raw_entry->ctime,
 +              ts = timespec64_to_timespec(inode->i_ctime);
 +              fat_time_unix2fat(sbi, &ts, &raw_entry->ctime,
                                  &raw_entry->cdate, &raw_entry->ctime_cs);
 -              fat_time_unix2fat(sbi, &inode->i_atime, &atime,
 +              ts = timespec64_to_timespec(inode->i_atime);
 +              fat_time_unix2fat(sbi, &ts, &atime,
                                  &raw_entry->adate, NULL);
        }
        spin_unlock(&sbi->inode_hash_lock);