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 misc fixes from Andrew Morton:
"13 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
memcg: disable hierarchy support if bound to the legacy cgroup hierarchy
mm: reorder can_do_mlock to fix audit denial
kasan, module: move MODULE_ALIGN macro into <linux/moduleloader.h>
kasan, module, vmalloc: rework shadow allocation for modules
fanotify: fix event filtering with FAN_ONDIR set
mm/nommu.c: export symbol max_mapnr
arch/c6x/include/asm/pgtable.h: define dummy pgprot_writecombine for !MMU
nilfs2: fix deadlock of segment constructor during recovery
mm: cma: fix CMA aligned offset calculation
mm, hugetlb: close race when setting PageTail for gigantic pages
mm, oom: do not fail __GFP_NOFAIL allocation if oom killer is disabled
drivers/rtc/rtc-s3c.c: add .needs_src_clk to s3c6410 RTC data
ocfs2: make append_dio an incompat feature

+63 -33
+5
arch/c6x/include/asm/pgtable.h
··· 67 67 */ 68 68 #define pgtable_cache_init() do { } while (0) 69 69 70 + /* 71 + * c6x is !MMU, so define the simpliest implementation 72 + */ 73 + #define pgprot_writecombine pgprot_noncached 74 + 70 75 #include <asm-generic/pgtable.h> 71 76 72 77 #endif /* _ASM_C6X_PGTABLE_H */
+1
drivers/rtc/rtc-s3c.c
··· 849 849 850 850 static struct s3c_rtc_data const s3c6410_rtc_data = { 851 851 .max_user_freq = 32768, 852 + .needs_src_clk = true, 852 853 .irq_handler = s3c6410_rtc_irq, 853 854 .set_freq = s3c6410_rtc_setfreq, 854 855 .enable_tick = s3c6410_rtc_enable_tick,
+4 -3
fs/nilfs2/segment.c
··· 1907 1907 struct the_nilfs *nilfs) 1908 1908 { 1909 1909 struct nilfs_inode_info *ii, *n; 1910 + int during_mount = !(sci->sc_super->s_flags & MS_ACTIVE); 1910 1911 int defer_iput = false; 1911 1912 1912 1913 spin_lock(&nilfs->ns_inode_lock); ··· 1920 1919 brelse(ii->i_bh); 1921 1920 ii->i_bh = NULL; 1922 1921 list_del_init(&ii->i_dirty); 1923 - if (!ii->vfs_inode.i_nlink) { 1922 + if (!ii->vfs_inode.i_nlink || during_mount) { 1924 1923 /* 1925 - * Defer calling iput() to avoid a deadlock 1926 - * over I_SYNC flag for inodes with i_nlink == 0 1924 + * Defer calling iput() to avoid deadlocks if 1925 + * i_nlink == 0 or mount is not yet finished. 1927 1926 */ 1928 1927 list_add_tail(&ii->i_dirty, &sci->sc_iput_queue); 1929 1928 defer_iput = true;
+2 -1
fs/notify/fanotify/fanotify.c
··· 143 143 !(marks_mask & FS_ISDIR & ~marks_ignored_mask)) 144 144 return false; 145 145 146 - if (event_mask & marks_mask & ~marks_ignored_mask) 146 + if (event_mask & FAN_ALL_OUTGOING_EVENTS & marks_mask & 147 + ~marks_ignored_mask) 147 148 return true; 148 149 149 150 return false;
+1 -1
fs/ocfs2/ocfs2.h
··· 502 502 503 503 static inline int ocfs2_supports_append_dio(struct ocfs2_super *osb) 504 504 { 505 - if (osb->s_feature_ro_compat & OCFS2_FEATURE_RO_COMPAT_APPEND_DIO) 505 + if (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_APPEND_DIO) 506 506 return 1; 507 507 return 0; 508 508 }
+8 -7
fs/ocfs2/ocfs2_fs.h
··· 102 102 | OCFS2_FEATURE_INCOMPAT_INDEXED_DIRS \ 103 103 | OCFS2_FEATURE_INCOMPAT_REFCOUNT_TREE \ 104 104 | OCFS2_FEATURE_INCOMPAT_DISCONTIG_BG \ 105 - | OCFS2_FEATURE_INCOMPAT_CLUSTERINFO) 105 + | OCFS2_FEATURE_INCOMPAT_CLUSTERINFO \ 106 + | OCFS2_FEATURE_INCOMPAT_APPEND_DIO) 106 107 #define OCFS2_FEATURE_RO_COMPAT_SUPP (OCFS2_FEATURE_RO_COMPAT_UNWRITTEN \ 107 108 | OCFS2_FEATURE_RO_COMPAT_USRQUOTA \ 108 - | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA \ 109 - | OCFS2_FEATURE_RO_COMPAT_APPEND_DIO) 109 + | OCFS2_FEATURE_RO_COMPAT_GRPQUOTA) 110 110 111 111 /* 112 112 * Heartbeat-only devices are missing journals and other files. The ··· 179 179 #define OCFS2_FEATURE_INCOMPAT_CLUSTERINFO 0x4000 180 180 181 181 /* 182 + * Append Direct IO support 183 + */ 184 + #define OCFS2_FEATURE_INCOMPAT_APPEND_DIO 0x8000 185 + 186 + /* 182 187 * backup superblock flag is used to indicate that this volume 183 188 * has backup superblocks. 184 189 */ ··· 205 200 #define OCFS2_FEATURE_RO_COMPAT_USRQUOTA 0x0002 206 201 #define OCFS2_FEATURE_RO_COMPAT_GRPQUOTA 0x0004 207 202 208 - /* 209 - * Append Direct IO support 210 - */ 211 - #define OCFS2_FEATURE_RO_COMPAT_APPEND_DIO 0x0008 212 203 213 204 /* The byte offset of the first backup block will be 1G. 214 205 * The following will be 4G, 16G, 64G, 256G and 1T.
+3 -6
include/linux/kasan.h
··· 5 5 6 6 struct kmem_cache; 7 7 struct page; 8 + struct vm_struct; 8 9 9 10 #ifdef CONFIG_KASAN 10 11 ··· 50 49 void kasan_slab_alloc(struct kmem_cache *s, void *object); 51 50 void kasan_slab_free(struct kmem_cache *s, void *object); 52 51 53 - #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT) 54 - 55 52 int kasan_module_alloc(void *addr, size_t size); 56 - void kasan_module_free(void *addr); 53 + void kasan_free_shadow(const struct vm_struct *vm); 57 54 58 55 #else /* CONFIG_KASAN */ 59 - 60 - #define MODULE_ALIGN 1 61 56 62 57 static inline void kasan_unpoison_shadow(const void *address, size_t size) {} 63 58 ··· 79 82 static inline void kasan_slab_free(struct kmem_cache *s, void *object) {} 80 83 81 84 static inline int kasan_module_alloc(void *addr, size_t size) { return 0; } 82 - static inline void kasan_module_free(void *addr) {} 85 + static inline void kasan_free_shadow(const struct vm_struct *vm) {} 83 86 84 87 #endif /* CONFIG_KASAN */ 85 88
+8
include/linux/moduleloader.h
··· 84 84 85 85 /* Any cleanup before freeing mod->module_init */ 86 86 void module_arch_freeing_init(struct module *mod); 87 + 88 + #ifdef CONFIG_KASAN 89 + #include <linux/kasan.h> 90 + #define MODULE_ALIGN (PAGE_SIZE << KASAN_SHADOW_SCALE_SHIFT) 91 + #else 92 + #define MODULE_ALIGN PAGE_SIZE 93 + #endif 94 + 87 95 #endif
+1
include/linux/vmalloc.h
··· 17 17 #define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ 18 18 #define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */ 19 19 #define VM_NO_GUARD 0x00000040 /* don't add guard page */ 20 + #define VM_KASAN 0x00000080 /* has allocated kasan shadow memory */ 20 21 /* bits [20..32] reserved for arch specific ioremap internals */ 21 22 22 23 /*
-2
kernel/module.c
··· 56 56 #include <linux/async.h> 57 57 #include <linux/percpu.h> 58 58 #include <linux/kmemleak.h> 59 - #include <linux/kasan.h> 60 59 #include <linux/jump_label.h> 61 60 #include <linux/pfn.h> 62 61 #include <linux/bsearch.h> ··· 1813 1814 void __weak module_memfree(void *module_region) 1814 1815 { 1815 1816 vfree(module_region); 1816 - kasan_module_free(module_region); 1817 1817 } 1818 1818 1819 1819 void __weak module_arch_cleanup(struct module *mod)
+7 -5
mm/cma.c
··· 64 64 return (1UL << (align_order - cma->order_per_bit)) - 1; 65 65 } 66 66 67 + /* 68 + * Find a PFN aligned to the specified order and return an offset represented in 69 + * order_per_bits. 70 + */ 67 71 static unsigned long cma_bitmap_aligned_offset(struct cma *cma, int align_order) 68 72 { 69 - unsigned int alignment; 70 - 71 73 if (align_order <= cma->order_per_bit) 72 74 return 0; 73 - alignment = 1UL << (align_order - cma->order_per_bit); 74 - return ALIGN(cma->base_pfn, alignment) - 75 - (cma->base_pfn >> cma->order_per_bit); 75 + 76 + return (ALIGN(cma->base_pfn, (1UL << align_order)) 77 + - cma->base_pfn) >> cma->order_per_bit; 76 78 } 77 79 78 80 static unsigned long cma_bitmap_maxno(struct cma *cma)
+3 -1
mm/hugetlb.c
··· 917 917 __SetPageHead(page); 918 918 __ClearPageReserved(page); 919 919 for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { 920 - __SetPageTail(p); 921 920 /* 922 921 * For gigantic hugepages allocated through bootmem at 923 922 * boot, it's safer to be consistent with the not-gigantic ··· 932 933 __ClearPageReserved(p); 933 934 set_page_count(p, 0); 934 935 p->first_page = page; 936 + /* Make sure p->first_page is always valid for PageTail() */ 937 + smp_wmb(); 938 + __SetPageTail(p); 935 939 } 936 940 } 937 941
+11 -3
mm/kasan/kasan.c
··· 29 29 #include <linux/stacktrace.h> 30 30 #include <linux/string.h> 31 31 #include <linux/types.h> 32 + #include <linux/vmalloc.h> 32 33 #include <linux/kasan.h> 33 34 34 35 #include "kasan.h" ··· 415 414 GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, 416 415 PAGE_KERNEL, VM_NO_GUARD, NUMA_NO_NODE, 417 416 __builtin_return_address(0)); 418 - return ret ? 0 : -ENOMEM; 417 + 418 + if (ret) { 419 + find_vm_area(addr)->flags |= VM_KASAN; 420 + return 0; 421 + } 422 + 423 + return -ENOMEM; 419 424 } 420 425 421 - void kasan_module_free(void *addr) 426 + void kasan_free_shadow(const struct vm_struct *vm) 422 427 { 423 - vfree(kasan_mem_to_shadow(addr)); 428 + if (vm->flags & VM_KASAN) 429 + vfree(kasan_mem_to_shadow(vm->addr)); 424 430 } 425 431 426 432 static void register_global(struct kasan_global *global)
+3 -1
mm/memcontrol.c
··· 5232 5232 * on for the root memcg is enough. 5233 5233 */ 5234 5234 if (cgroup_on_dfl(root_css->cgroup)) 5235 - mem_cgroup_from_css(root_css)->use_hierarchy = true; 5235 + root_mem_cgroup->use_hierarchy = true; 5236 + else 5237 + root_mem_cgroup->use_hierarchy = false; 5236 5238 } 5237 5239 5238 5240 static u64 memory_current_read(struct cgroup_subsys_state *css,
+2 -2
mm/mlock.c
··· 26 26 27 27 int can_do_mlock(void) 28 28 { 29 - if (capable(CAP_IPC_LOCK)) 30 - return 1; 31 29 if (rlimit(RLIMIT_MEMLOCK) != 0) 30 + return 1; 31 + if (capable(CAP_IPC_LOCK)) 32 32 return 1; 33 33 return 0; 34 34 }
+1
mm/nommu.c
··· 62 62 EXPORT_SYMBOL(high_memory); 63 63 struct page *mem_map; 64 64 unsigned long max_mapnr; 65 + EXPORT_SYMBOL(max_mapnr); 65 66 unsigned long highest_memmap_pfn; 66 67 struct percpu_counter vm_committed_as; 67 68 int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
+2 -1
mm/page_alloc.c
··· 2373 2373 goto out; 2374 2374 } 2375 2375 /* Exhausted what can be done so it's blamo time */ 2376 - if (out_of_memory(ac->zonelist, gfp_mask, order, ac->nodemask, false)) 2376 + if (out_of_memory(ac->zonelist, gfp_mask, order, ac->nodemask, false) 2377 + || WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL)) 2377 2378 *did_some_progress = 1; 2378 2379 out: 2379 2380 oom_zonelist_unlock(ac->zonelist, gfp_mask);
+1
mm/vmalloc.c
··· 1418 1418 spin_unlock(&vmap_area_lock); 1419 1419 1420 1420 vmap_debug_free_range(va->va_start, va->va_end); 1421 + kasan_free_shadow(vm); 1421 1422 free_unmap_vmap_area(va); 1422 1423 vm->size -= PAGE_SIZE; 1423 1424