Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge fixes from Andrew Morton:
"11 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm: silently skip readahead for DAX inodes
dax: fix device-dax region base
fs/seq_file: fix out-of-bounds read
mm: memcontrol: avoid unused function warning
mm: clarify COMPACTION Kconfig text
treewide: replace config_enabled() with IS_ENABLED() (2nd round)
printk: fix parsing of "brl=" option
soft_dirty: fix soft_dirty during THP split
sysctl: handle error writing UINT_MAX to u32 fields
get_maintainer: quiet noisy implicit -f vcs_file_exists checking
byteswap: don't use __builtin_bswap*() with sparse

+108 -35
+2 -2
arch/mips/include/asm/page.h
··· 164 164 */ 165 165 static inline unsigned long ___pa(unsigned long x) 166 166 { 167 - if (config_enabled(CONFIG_64BIT)) { 167 + if (IS_ENABLED(CONFIG_64BIT)) { 168 168 /* 169 169 * For MIPS64 the virtual address may either be in one of 170 170 * the compatibility segements ckseg0 or ckseg1, or it may ··· 173 173 return x < CKSEG0 ? XPHYSADDR(x) : CPHYSADDR(x); 174 174 } 175 175 176 - if (!config_enabled(CONFIG_EVA)) { 176 + if (!IS_ENABLED(CONFIG_EVA)) { 177 177 /* 178 178 * We're using the standard MIPS32 legacy memory map, ie. 179 179 * the address x is going to be in kseg0 or kseg1. We can
+2 -4
arch/s390/kernel/setup.c
··· 204 204 #endif 205 205 } 206 206 } else if (MACHINE_IS_KVM) { 207 - if (sclp.has_vt220 && 208 - config_enabled(CONFIG_SCLP_VT220_CONSOLE)) 207 + if (sclp.has_vt220 && IS_ENABLED(CONFIG_SCLP_VT220_CONSOLE)) 209 208 SET_CONSOLE_VT220; 210 - else if (sclp.has_linemode && 211 - config_enabled(CONFIG_SCLP_CONSOLE)) 209 + else if (sclp.has_linemode && IS_ENABLED(CONFIG_SCLP_CONSOLE)) 212 210 SET_CONSOLE_SCLP; 213 211 else 214 212 SET_CONSOLE_HVC;
+1 -1
arch/x86/mm/kaslr.c
··· 77 77 */ 78 78 static inline bool kaslr_memory_enabled(void) 79 79 { 80 - return kaslr_enabled() && !config_enabled(CONFIG_KASAN); 80 + return kaslr_enabled() && !IS_ENABLED(CONFIG_KASAN); 81 81 } 82 82 83 83 /* Initialize base and padding for each memory region randomized with KASLR */
+3
drivers/dax/pmem.c
··· 116 116 if (rc) 117 117 return rc; 118 118 119 + /* adjust the dax_region resource to the start of data */ 120 + res.start += le64_to_cpu(pfn_sb->dataoff); 121 + 119 122 nd_region = to_nd_region(dev->parent); 120 123 dax_region = alloc_dax_region(dev, nd_region->id, &res, 121 124 le32_to_cpu(pfn_sb->align), addr, PFN_DEV|PFN_MAP);
+3 -1
fs/seq_file.c
··· 223 223 size -= n; 224 224 buf += n; 225 225 copied += n; 226 - if (!m->count) 226 + if (!m->count) { 227 + m->from = 0; 227 228 m->index++; 229 + } 228 230 if (!size) 229 231 goto Done; 230 232 }
+6 -2
include/linux/compiler-gcc.h
··· 242 242 */ 243 243 #define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) 244 244 245 - #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP 245 + /* 246 + * sparse (__CHECKER__) pretends to be gcc, but can't do constant 247 + * folding in __builtin_bswap*() (yet), so don't set these for it. 248 + */ 249 + #if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__) 246 250 #if GCC_VERSION >= 40400 247 251 #define __HAVE_BUILTIN_BSWAP32__ 248 252 #define __HAVE_BUILTIN_BSWAP64__ ··· 254 250 #if GCC_VERSION >= 40800 255 251 #define __HAVE_BUILTIN_BSWAP16__ 256 252 #endif 257 - #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ 253 + #endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */ 258 254 259 255 #if GCC_VERSION >= 50000 260 256 #define KASAN_ABI_VERSION 4
+2
include/linux/sysctl.h
··· 42 42 void __user *, size_t *, loff_t *); 43 43 extern int proc_dointvec(struct ctl_table *, int, 44 44 void __user *, size_t *, loff_t *); 45 + extern int proc_douintvec(struct ctl_table *, int, 46 + void __user *, size_t *, loff_t *); 45 47 extern int proc_dointvec_minmax(struct ctl_table *, int, 46 48 void __user *, size_t *, loff_t *); 47 49 extern int proc_dointvec_jiffies(struct ctl_table *, int,
+2 -2
kernel/printk/braille.c
··· 9 9 10 10 char *_braille_console_setup(char **str, char **brl_options) 11 11 { 12 - if (!memcmp(*str, "brl,", 4)) { 12 + if (!strncmp(*str, "brl,", 4)) { 13 13 *brl_options = ""; 14 14 *str += 4; 15 - } else if (!memcmp(str, "brl=", 4)) { 15 + } else if (!strncmp(*str, "brl=", 4)) { 16 16 *brl_options = *str + 4; 17 17 *str = strchr(*brl_options, ','); 18 18 if (!*str)
+43 -2
kernel/sysctl.c
··· 2140 2140 return 0; 2141 2141 } 2142 2142 2143 + static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp, 2144 + int *valp, 2145 + int write, void *data) 2146 + { 2147 + if (write) { 2148 + if (*negp) 2149 + return -EINVAL; 2150 + *valp = *lvalp; 2151 + } else { 2152 + unsigned int val = *valp; 2153 + *lvalp = (unsigned long)val; 2154 + } 2155 + return 0; 2156 + } 2157 + 2143 2158 static const char proc_wspace_sep[] = { ' ', '\t', '\n' }; 2144 2159 2145 2160 static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, ··· 2274 2259 int proc_dointvec(struct ctl_table *table, int write, 2275 2260 void __user *buffer, size_t *lenp, loff_t *ppos) 2276 2261 { 2277 - return do_proc_dointvec(table,write,buffer,lenp,ppos, 2278 - NULL,NULL); 2262 + return do_proc_dointvec(table, write, buffer, lenp, ppos, NULL, NULL); 2263 + } 2264 + 2265 + /** 2266 + * proc_douintvec - read a vector of unsigned integers 2267 + * @table: the sysctl table 2268 + * @write: %TRUE if this is a write to the sysctl file 2269 + * @buffer: the user buffer 2270 + * @lenp: the size of the user buffer 2271 + * @ppos: file position 2272 + * 2273 + * Reads/writes up to table->maxlen/sizeof(unsigned int) unsigned integer 2274 + * values from/to the user buffer, treated as an ASCII string. 2275 + * 2276 + * Returns 0 on success. 2277 + */ 2278 + int proc_douintvec(struct ctl_table *table, int write, 2279 + void __user *buffer, size_t *lenp, loff_t *ppos) 2280 + { 2281 + return do_proc_dointvec(table, write, buffer, lenp, ppos, 2282 + do_proc_douintvec_conv, NULL); 2279 2283 } 2280 2284 2281 2285 /* ··· 2892 2858 return -ENOSYS; 2893 2859 } 2894 2860 2861 + int proc_douintvec(struct ctl_table *table, int write, 2862 + void __user *buffer, size_t *lenp, loff_t *ppos) 2863 + { 2864 + return -ENOSYS; 2865 + } 2866 + 2895 2867 int proc_dointvec_minmax(struct ctl_table *table, int write, 2896 2868 void __user *buffer, size_t *lenp, loff_t *ppos) 2897 2869 { ··· 2943 2903 * exception granted :-) 2944 2904 */ 2945 2905 EXPORT_SYMBOL(proc_dointvec); 2906 + EXPORT_SYMBOL(proc_douintvec); 2946 2907 EXPORT_SYMBOL(proc_dointvec_jiffies); 2947 2908 EXPORT_SYMBOL(proc_dointvec_minmax); 2948 2909 EXPORT_SYMBOL(proc_dointvec_userhz_jiffies);
+8 -1
mm/Kconfig
··· 262 262 select MIGRATION 263 263 depends on MMU 264 264 help 265 - Allows the compaction of memory for the allocation of huge pages. 265 + Compaction is the only memory management component to form 266 + high order (larger physically contiguous) memory blocks 267 + reliably. The page allocator relies on compaction heavily and 268 + the lack of the feature can lead to unexpected OOM killer 269 + invocations for high order memory requests. You shouldn't 270 + disable this option unless there really is a strong reason for 271 + it and then we would be really interested to hear about that at 272 + linux-mm@kvack.org. 266 273 267 274 # 268 275 # support for page migration
+6 -1
mm/huge_memory.c
··· 1512 1512 struct page *page; 1513 1513 pgtable_t pgtable; 1514 1514 pmd_t _pmd; 1515 - bool young, write, dirty; 1515 + bool young, write, dirty, soft_dirty; 1516 1516 unsigned long addr; 1517 1517 int i; 1518 1518 ··· 1546 1546 write = pmd_write(*pmd); 1547 1547 young = pmd_young(*pmd); 1548 1548 dirty = pmd_dirty(*pmd); 1549 + soft_dirty = pmd_soft_dirty(*pmd); 1549 1550 1550 1551 pmdp_huge_split_prepare(vma, haddr, pmd); 1551 1552 pgtable = pgtable_trans_huge_withdraw(mm, pmd); ··· 1563 1562 swp_entry_t swp_entry; 1564 1563 swp_entry = make_migration_entry(page + i, write); 1565 1564 entry = swp_entry_to_pte(swp_entry); 1565 + if (soft_dirty) 1566 + entry = pte_swp_mksoft_dirty(entry); 1566 1567 } else { 1567 1568 entry = mk_pte(page + i, vma->vm_page_prot); 1568 1569 entry = maybe_mkwrite(entry, vma); ··· 1572 1569 entry = pte_wrprotect(entry); 1573 1570 if (!young) 1574 1571 entry = pte_mkold(entry); 1572 + if (soft_dirty) 1573 + entry = pte_mksoft_dirty(entry); 1575 1574 } 1576 1575 if (dirty) 1577 1576 SetPageDirty(page + i);
+18 -18
mm/memcontrol.c
··· 4082 4082 atomic_add(n, &memcg->id.ref); 4083 4083 } 4084 4084 4085 - static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg) 4086 - { 4087 - while (!atomic_inc_not_zero(&memcg->id.ref)) { 4088 - /* 4089 - * The root cgroup cannot be destroyed, so it's refcount must 4090 - * always be >= 1. 4091 - */ 4092 - if (WARN_ON_ONCE(memcg == root_mem_cgroup)) { 4093 - VM_BUG_ON(1); 4094 - break; 4095 - } 4096 - memcg = parent_mem_cgroup(memcg); 4097 - if (!memcg) 4098 - memcg = root_mem_cgroup; 4099 - } 4100 - return memcg; 4101 - } 4102 - 4103 4085 static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n) 4104 4086 { 4105 4087 if (atomic_sub_and_test(n, &memcg->id.ref)) { ··· 5803 5821 subsys_initcall(mem_cgroup_init); 5804 5822 5805 5823 #ifdef CONFIG_MEMCG_SWAP 5824 + static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg) 5825 + { 5826 + while (!atomic_inc_not_zero(&memcg->id.ref)) { 5827 + /* 5828 + * The root cgroup cannot be destroyed, so it's refcount must 5829 + * always be >= 1. 5830 + */ 5831 + if (WARN_ON_ONCE(memcg == root_mem_cgroup)) { 5832 + VM_BUG_ON(1); 5833 + break; 5834 + } 5835 + memcg = parent_mem_cgroup(memcg); 5836 + if (!memcg) 5837 + memcg = root_mem_cgroup; 5838 + } 5839 + return memcg; 5840 + } 5841 + 5806 5842 /** 5807 5843 * mem_cgroup_swapout - transfer a memsw charge to swap 5808 5844 * @page: page whose memsw charge to transfer
+9
mm/readahead.c
··· 8 8 */ 9 9 10 10 #include <linux/kernel.h> 11 + #include <linux/dax.h> 11 12 #include <linux/gfp.h> 12 13 #include <linux/export.h> 13 14 #include <linux/blkdev.h> ··· 544 543 { 545 544 if (!mapping || !mapping->a_ops) 546 545 return -EINVAL; 546 + 547 + /* 548 + * Readahead doesn't make sense for DAX inodes, but we don't want it 549 + * to report a failure either. Instead, we just return success and 550 + * don't do any work. 551 + */ 552 + if (dax_mapping(mapping)) 553 + return 0; 547 554 548 555 return force_page_cache_readahead(mapping, filp, index, nr); 549 556 }
+3 -1
scripts/get_maintainer.pl
··· 2136 2136 2137 2137 my $cmd = $VCS_cmds{"file_exists_cmd"}; 2138 2138 $cmd =~ s/(\$\w+)/$1/eeg; # interpolate $cmd 2139 - 2139 + $cmd .= " 2>&1"; 2140 2140 $exists = &{$VCS_cmds{"execute_cmd"}}($cmd); 2141 + 2142 + return 0 if ($? != 0); 2141 2143 2142 2144 return $exists; 2143 2145 }