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:
"12 patches.

Subsystems affected by this patch series: sysctl, binfmt, ia64, mm
(memory-failure, folios, kasan, and psi), selftests, and ocfs2"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
ocfs2: fix a deadlock when commit trans
jbd2: export jbd2_journal_[grab|put]_journal_head
psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n
psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n
mm, kasan: use compare-exchange operation to set KASAN page tag
kasan: test: fix compatibility with FORTIFY_SOURCE
tools/testing/scatterlist: add missing defines
mm: page->mapping folio->mapping should have the same offset
memory-failure: fetch compound_head after pgmap_pfn_valid()
ia64: make IA64_MCA_RECOVERY bool instead of tristate
binfmt_misc: fix crash when load/unload module
include/linux/sysctl.h: fix register_sysctl_mount_point() return type

+91 -70
+1 -1
arch/ia64/Kconfig
··· 318 318 depends on PROC_KCORE 319 319 320 320 config IA64_MCA_RECOVERY 321 - tristate "MCA recovery from errors other than TLB." 321 + bool "MCA recovery from errors other than TLB." 322 322 323 323 config IA64_PALINFO 324 324 tristate "/proc/pal support"
+4 -4
fs/binfmt_misc.c
··· 817 817 }; 818 818 MODULE_ALIAS_FS("binfmt_misc"); 819 819 820 + static struct ctl_table_header *binfmt_misc_header; 821 + 820 822 static int __init init_misc_binfmt(void) 821 823 { 822 824 int err = register_filesystem(&bm_fs_type); 823 825 if (!err) 824 826 insert_binfmt(&misc_format); 825 - if (!register_sysctl_mount_point("fs/binfmt_misc")) { 826 - pr_warn("Failed to create fs/binfmt_misc sysctl mount point"); 827 - return -ENOMEM; 828 - } 827 + binfmt_misc_header = register_sysctl_mount_point("fs/binfmt_misc"); 829 828 return 0; 830 829 } 831 830 832 831 static void __exit exit_misc_binfmt(void) 833 832 { 833 + unregister_sysctl_table(binfmt_misc_header); 834 834 unregister_binfmt(&misc_format); 835 835 unregister_filesystem(&bm_fs_type); 836 836 }
+2
fs/jbd2/journal.c
··· 2972 2972 jbd_unlock_bh_journal_head(bh); 2973 2973 return jh; 2974 2974 } 2975 + EXPORT_SYMBOL(jbd2_journal_grab_journal_head); 2975 2976 2976 2977 static void __journal_remove_journal_head(struct buffer_head *bh) 2977 2978 { ··· 3025 3024 jbd_unlock_bh_journal_head(bh); 3026 3025 } 3027 3026 } 3027 + EXPORT_SYMBOL(jbd2_journal_put_journal_head); 3028 3028 3029 3029 /* 3030 3030 * Initialize jbd inode head
+11 -14
fs/ocfs2/suballoc.c
··· 1251 1251 { 1252 1252 struct ocfs2_group_desc *bg = (struct ocfs2_group_desc *) bg_bh->b_data; 1253 1253 struct journal_head *jh; 1254 - int ret = 1; 1254 + int ret; 1255 1255 1256 1256 if (ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap)) 1257 1257 return 0; 1258 1258 1259 - if (!buffer_jbd(bg_bh)) 1259 + jh = jbd2_journal_grab_journal_head(bg_bh); 1260 + if (!jh) 1260 1261 return 1; 1261 1262 1262 - jbd_lock_bh_journal_head(bg_bh); 1263 - if (buffer_jbd(bg_bh)) { 1264 - jh = bh2jh(bg_bh); 1265 - spin_lock(&jh->b_state_lock); 1266 - bg = (struct ocfs2_group_desc *) jh->b_committed_data; 1267 - if (bg) 1268 - ret = !ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap); 1269 - else 1270 - ret = 1; 1271 - spin_unlock(&jh->b_state_lock); 1272 - } 1273 - jbd_unlock_bh_journal_head(bg_bh); 1263 + spin_lock(&jh->b_state_lock); 1264 + bg = (struct ocfs2_group_desc *) jh->b_committed_data; 1265 + if (bg) 1266 + ret = !ocfs2_test_bit(nr, (unsigned long *)bg->bg_bitmap); 1267 + else 1268 + ret = 1; 1269 + spin_unlock(&jh->b_state_lock); 1270 + jbd2_journal_put_journal_head(jh); 1274 1271 1275 1272 return ret; 1276 1273 }
+12 -5
include/linux/mm.h
··· 1506 1506 1507 1507 static inline void page_kasan_tag_set(struct page *page, u8 tag) 1508 1508 { 1509 - if (kasan_enabled()) { 1510 - tag ^= 0xff; 1511 - page->flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT); 1512 - page->flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT; 1513 - } 1509 + unsigned long old_flags, flags; 1510 + 1511 + if (!kasan_enabled()) 1512 + return; 1513 + 1514 + tag ^= 0xff; 1515 + old_flags = READ_ONCE(page->flags); 1516 + do { 1517 + flags = old_flags; 1518 + flags &= ~(KASAN_TAG_MASK << KASAN_TAG_PGSHIFT); 1519 + flags |= (tag & KASAN_TAG_MASK) << KASAN_TAG_PGSHIFT; 1520 + } while (unlikely(!try_cmpxchg(&page->flags, &old_flags, flags))); 1514 1521 } 1515 1522 1516 1523 static inline void page_kasan_tag_reset(struct page *page)
+1
include/linux/mm_types.h
··· 261 261 static_assert(offsetof(struct page, pg) == offsetof(struct folio, fl)) 262 262 FOLIO_MATCH(flags, flags); 263 263 FOLIO_MATCH(lru, lru); 264 + FOLIO_MATCH(mapping, mapping); 264 265 FOLIO_MATCH(compound_head, lru); 265 266 FOLIO_MATCH(index, index); 266 267 FOLIO_MATCH(private, private);
+5 -6
include/linux/psi.h
··· 25 25 void psi_memstall_leave(unsigned long *flags); 26 26 27 27 int psi_show(struct seq_file *s, struct psi_group *group, enum psi_res res); 28 - 29 - #ifdef CONFIG_CGROUPS 30 - int psi_cgroup_alloc(struct cgroup *cgrp); 31 - void psi_cgroup_free(struct cgroup *cgrp); 32 - void cgroup_move_task(struct task_struct *p, struct css_set *to); 33 - 34 28 struct psi_trigger *psi_trigger_create(struct psi_group *group, 35 29 char *buf, size_t nbytes, enum psi_res res); 36 30 void psi_trigger_destroy(struct psi_trigger *t); 37 31 38 32 __poll_t psi_trigger_poll(void **trigger_ptr, struct file *file, 39 33 poll_table *wait); 34 + 35 + #ifdef CONFIG_CGROUPS 36 + int psi_cgroup_alloc(struct cgroup *cgrp); 37 + void psi_cgroup_free(struct cgroup *cgrp); 38 + void cgroup_move_task(struct task_struct *p, struct css_set *to); 40 39 #endif 41 40 42 41 #else /* CONFIG_PSI */
+1 -1
include/linux/sysctl.h
··· 265 265 return NULL; 266 266 } 267 267 268 - static inline struct sysctl_header *register_sysctl_mount_point(const char *path) 268 + static inline struct ctl_table_header *register_sysctl_mount_point(const char *path) 269 269 { 270 270 return NULL; 271 271 }
+41 -38
kernel/sched/psi.c
··· 1082 1082 return 0; 1083 1083 } 1084 1084 1085 - static int psi_io_show(struct seq_file *m, void *v) 1086 - { 1087 - return psi_show(m, &psi_system, PSI_IO); 1088 - } 1089 - 1090 - static int psi_memory_show(struct seq_file *m, void *v) 1091 - { 1092 - return psi_show(m, &psi_system, PSI_MEM); 1093 - } 1094 - 1095 - static int psi_cpu_show(struct seq_file *m, void *v) 1096 - { 1097 - return psi_show(m, &psi_system, PSI_CPU); 1098 - } 1099 - 1100 - static int psi_open(struct file *file, int (*psi_show)(struct seq_file *, void *)) 1101 - { 1102 - if (file->f_mode & FMODE_WRITE && !capable(CAP_SYS_RESOURCE)) 1103 - return -EPERM; 1104 - 1105 - return single_open(file, psi_show, NULL); 1106 - } 1107 - 1108 - static int psi_io_open(struct inode *inode, struct file *file) 1109 - { 1110 - return psi_open(file, psi_io_show); 1111 - } 1112 - 1113 - static int psi_memory_open(struct inode *inode, struct file *file) 1114 - { 1115 - return psi_open(file, psi_memory_show); 1116 - } 1117 - 1118 - static int psi_cpu_open(struct inode *inode, struct file *file) 1119 - { 1120 - return psi_open(file, psi_cpu_show); 1121 - } 1122 - 1123 1085 struct psi_trigger *psi_trigger_create(struct psi_group *group, 1124 1086 char *buf, size_t nbytes, enum psi_res res) 1125 1087 { ··· 1240 1278 return ret; 1241 1279 } 1242 1280 1281 + #ifdef CONFIG_PROC_FS 1282 + static int psi_io_show(struct seq_file *m, void *v) 1283 + { 1284 + return psi_show(m, &psi_system, PSI_IO); 1285 + } 1286 + 1287 + static int psi_memory_show(struct seq_file *m, void *v) 1288 + { 1289 + return psi_show(m, &psi_system, PSI_MEM); 1290 + } 1291 + 1292 + static int psi_cpu_show(struct seq_file *m, void *v) 1293 + { 1294 + return psi_show(m, &psi_system, PSI_CPU); 1295 + } 1296 + 1297 + static int psi_open(struct file *file, int (*psi_show)(struct seq_file *, void *)) 1298 + { 1299 + if (file->f_mode & FMODE_WRITE && !capable(CAP_SYS_RESOURCE)) 1300 + return -EPERM; 1301 + 1302 + return single_open(file, psi_show, NULL); 1303 + } 1304 + 1305 + static int psi_io_open(struct inode *inode, struct file *file) 1306 + { 1307 + return psi_open(file, psi_io_show); 1308 + } 1309 + 1310 + static int psi_memory_open(struct inode *inode, struct file *file) 1311 + { 1312 + return psi_open(file, psi_memory_show); 1313 + } 1314 + 1315 + static int psi_cpu_open(struct inode *inode, struct file *file) 1316 + { 1317 + return psi_open(file, psi_cpu_show); 1318 + } 1319 + 1243 1320 static ssize_t psi_write(struct file *file, const char __user *user_buf, 1244 1321 size_t nbytes, enum psi_res res) 1245 1322 { ··· 1393 1392 return 0; 1394 1393 } 1395 1394 module_init(psi_proc_init); 1395 + 1396 + #endif /* CONFIG_PROC_FS */
+5
lib/test_kasan.c
··· 492 492 ptr = kmalloc(size, GFP_KERNEL); 493 493 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); 494 494 495 + OPTIMIZER_HIDE_VAR(ptr); 495 496 OPTIMIZER_HIDE_VAR(size); 496 497 KUNIT_EXPECT_KASAN_FAIL(test, 497 498 memset(ptr, 0, size + KASAN_GRANULE_SIZE)); ··· 516 515 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); 517 516 518 517 memset((char *)ptr, 0, 64); 518 + OPTIMIZER_HIDE_VAR(ptr); 519 519 OPTIMIZER_HIDE_VAR(invalid_size); 520 520 KUNIT_EXPECT_KASAN_FAIL(test, 521 521 memmove((char *)ptr, (char *)ptr + 4, invalid_size)); ··· 533 531 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); 534 532 535 533 memset((char *)ptr, 0, 64); 534 + OPTIMIZER_HIDE_VAR(ptr); 536 535 KUNIT_EXPECT_KASAN_FAIL(test, 537 536 memmove((char *)ptr, (char *)ptr + 4, invalid_size)); 538 537 kfree(ptr); ··· 896 893 ptr = kmalloc(size, GFP_KERNEL | __GFP_ZERO); 897 894 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); 898 895 896 + OPTIMIZER_HIDE_VAR(ptr); 899 897 OPTIMIZER_HIDE_VAR(size); 900 898 KUNIT_EXPECT_KASAN_FAIL(test, 901 899 kasan_ptr_result = memchr(ptr, '1', size + 1)); ··· 923 919 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ptr); 924 920 memset(arr, 0, sizeof(arr)); 925 921 922 + OPTIMIZER_HIDE_VAR(ptr); 926 923 OPTIMIZER_HIDE_VAR(size); 927 924 KUNIT_EXPECT_KASAN_FAIL(test, 928 925 kasan_int_result = memcmp(ptr, arr, size+1));
+6
mm/memory-failure.c
··· 1596 1596 } 1597 1597 1598 1598 /* 1599 + * Pages instantiated by device-dax (not filesystem-dax) 1600 + * may be compound pages. 1601 + */ 1602 + page = compound_head(page); 1603 + 1604 + /* 1599 1605 * Prevent the inode from being freed while we are interrogating 1600 1606 * the address_space, typically this would be handled by 1601 1607 * lock_page(), but dax pages do not use the page lock. This
+2 -1
tools/testing/scatterlist/linux/mm.h
··· 74 74 __UNIQUE_ID(min1_), __UNIQUE_ID(min2_), \ 75 75 x, y) 76 76 77 - #define preemptible() (1) 77 + #define pagefault_disabled() (0) 78 78 79 79 static inline void *kmap(struct page *page) 80 80 { ··· 127 127 #define kmemleak_free(a) 128 128 129 129 #define PageSlab(p) (0) 130 + #define flush_dcache_page(p) 130 131 131 132 #define MAX_ERRNO 4095 132 133