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:
"Three fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm/ksm.c: don't WARN if page is still mapped in remove_stable_node()
mm/memory_hotplug: don't access uninitialized memmaps in shrink_zone_span()
Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()"

+54 -34
+34 -24
fs/ocfs2/xattr.c
··· 1490 1490 return loc->xl_ops->xlo_check_space(loc, xi); 1491 1491 } 1492 1492 1493 + static void ocfs2_xa_add_entry(struct ocfs2_xa_loc *loc, u32 name_hash) 1494 + { 1495 + loc->xl_ops->xlo_add_entry(loc, name_hash); 1496 + loc->xl_entry->xe_name_hash = cpu_to_le32(name_hash); 1497 + /* 1498 + * We can't leave the new entry's xe_name_offset at zero or 1499 + * add_namevalue() will go nuts. We set it to the size of our 1500 + * storage so that it can never be less than any other entry. 1501 + */ 1502 + loc->xl_entry->xe_name_offset = cpu_to_le16(loc->xl_size); 1503 + } 1504 + 1493 1505 static void ocfs2_xa_add_namevalue(struct ocfs2_xa_loc *loc, 1494 1506 struct ocfs2_xattr_info *xi) 1495 1507 { ··· 2133 2121 if (rc) 2134 2122 goto out; 2135 2123 2136 - if (!loc->xl_entry) { 2137 - rc = -EINVAL; 2138 - goto out; 2139 - } 2140 - 2141 - if (ocfs2_xa_can_reuse_entry(loc, xi)) { 2142 - orig_value_size = loc->xl_entry->xe_value_size; 2143 - rc = ocfs2_xa_reuse_entry(loc, xi, ctxt); 2144 - if (rc) 2145 - goto out; 2146 - goto alloc_value; 2147 - } 2148 - 2149 - if (!ocfs2_xattr_is_local(loc->xl_entry)) { 2150 - orig_clusters = ocfs2_xa_value_clusters(loc); 2151 - rc = ocfs2_xa_value_truncate(loc, 0, ctxt); 2152 - if (rc) { 2153 - mlog_errno(rc); 2154 - ocfs2_xa_cleanup_value_truncate(loc, 2155 - "overwriting", 2156 - orig_clusters); 2157 - goto out; 2124 + if (loc->xl_entry) { 2125 + if (ocfs2_xa_can_reuse_entry(loc, xi)) { 2126 + orig_value_size = loc->xl_entry->xe_value_size; 2127 + rc = ocfs2_xa_reuse_entry(loc, xi, ctxt); 2128 + if (rc) 2129 + goto out; 2130 + goto alloc_value; 2158 2131 } 2159 - } 2160 - ocfs2_xa_wipe_namevalue(loc); 2132 + 2133 + if (!ocfs2_xattr_is_local(loc->xl_entry)) { 2134 + orig_clusters = ocfs2_xa_value_clusters(loc); 2135 + rc = ocfs2_xa_value_truncate(loc, 0, ctxt); 2136 + if (rc) { 2137 + mlog_errno(rc); 2138 + ocfs2_xa_cleanup_value_truncate(loc, 2139 + "overwriting", 2140 + orig_clusters); 2141 + goto out; 2142 + } 2143 + } 2144 + ocfs2_xa_wipe_namevalue(loc); 2145 + } else 2146 + ocfs2_xa_add_entry(loc, name_hash); 2161 2147 2162 2148 /* 2163 2149 * If we get here, we have a blank entry. Fill it. We grow our
+7 -7
mm/ksm.c
··· 885 885 return 0; 886 886 } 887 887 888 - if (WARN_ON_ONCE(page_mapped(page))) { 889 - /* 890 - * This should not happen: but if it does, just refuse to let 891 - * merge_across_nodes be switched - there is no need to panic. 892 - */ 893 - err = -EBUSY; 894 - } else { 888 + /* 889 + * Page could be still mapped if this races with __mmput() running in 890 + * between ksm_exit() and exit_mmap(). Just refuse to let 891 + * merge_across_nodes/max_page_sharing be switched. 892 + */ 893 + err = -EBUSY; 894 + if (!page_mapped(page)) { 895 895 /* 896 896 * The stable node did not yet appear stale to get_ksm_page(), 897 897 * since that allows for an unmapped ksm page to be recognized
+13 -3
mm/memory_hotplug.c
··· 331 331 unsigned long end_pfn) 332 332 { 333 333 for (; start_pfn < end_pfn; start_pfn += PAGES_PER_SUBSECTION) { 334 - if (unlikely(!pfn_valid(start_pfn))) 334 + if (unlikely(!pfn_to_online_page(start_pfn))) 335 335 continue; 336 336 337 337 if (unlikely(pfn_to_nid(start_pfn) != nid)) ··· 356 356 /* pfn is the end pfn of a memory section. */ 357 357 pfn = end_pfn - 1; 358 358 for (; pfn >= start_pfn; pfn -= PAGES_PER_SUBSECTION) { 359 - if (unlikely(!pfn_valid(pfn))) 359 + if (unlikely(!pfn_to_online_page(pfn))) 360 360 continue; 361 361 362 362 if (unlikely(pfn_to_nid(pfn) != nid)) ··· 415 415 */ 416 416 pfn = zone_start_pfn; 417 417 for (; pfn < zone_end_pfn; pfn += PAGES_PER_SUBSECTION) { 418 - if (unlikely(!pfn_valid(pfn))) 418 + if (unlikely(!pfn_to_online_page(pfn))) 419 419 continue; 420 420 421 421 if (page_zone(pfn_to_page(pfn)) != zone) ··· 470 470 { 471 471 struct pglist_data *pgdat = zone->zone_pgdat; 472 472 unsigned long flags; 473 + 474 + #ifdef CONFIG_ZONE_DEVICE 475 + /* 476 + * Zone shrinking code cannot properly deal with ZONE_DEVICE. So 477 + * we will not try to shrink the zones - which is okay as 478 + * set_zone_contiguous() cannot deal with ZONE_DEVICE either way. 479 + */ 480 + if (zone_idx(zone) == ZONE_DEVICE) 481 + return; 482 + #endif 473 483 474 484 pgdat_resize_lock(zone->zone_pgdat, &flags); 475 485 shrink_zone_span(zone, start_pfn, start_pfn + nr_pages);