Five fixes * branch 'akpm': pcmcia: fix socket refcount decrementing on each resume mm: fix UP THP spin_is_locked BUGs drivers/leds/leds-lm3530.c: fix setting pltfm->als_vmax mm: compaction: check for overlapping nodes during isolation for migration nilfs2: avoid overflowing segment numbers in nilfs_ioctl_clean_segments()
Unified · Split
| @@ -164,8 +164,8 @@ static int lm3530_init_registers(struct lm3530_data *drvdata) · 163 unmodified lines | ||
| 164 | 164 | |
| 165 | 165 | if (drvdata->mode == LM3530_BL_MODE_ALS) { |
| 166 | 166 | if (pltfm->als_vmax == 0) { |
| 167 | − pltfm->als_vmin = als_vmin = 0; | |
| 168 | − pltfm->als_vmin = als_vmax = LM3530_ALS_WINDOW_mV; | |
| 167 | + pltfm->als_vmin = 0; | |
| 168 | + pltfm->als_vmax = LM3530_ALS_WINDOW_mV; | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | als_vmin = pltfm->als_vmin; |
| @@ -1269,10 +1269,8 @@ static int pcmcia_bus_add(struct pcmcia_socket *skt) · 1268 unmodified lines | ||
| 1269 | 1269 | |
| 1270 | 1270 | static int pcmcia_bus_early_resume(struct pcmcia_socket *skt) |
| 1271 | 1271 | { |
| 1272 | − if (!verify_cis_cache(skt)) { | |
| 1273 | − pcmcia_put_socket(skt); | |
| 1272 | + if (!verify_cis_cache(skt)) | |
| 1274 | 1273 | return 0; |
| 1275 | − } | |
| 1276 | 1274 | |
| 1277 | 1275 | dev_dbg(&skt->dev, "cis mismatch - different card\n"); |
| 1278 | 1276 | |
| @@ -603,6 +603,8 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, · 602 unmodified lines | ||
| 603 | 603 | nsegs = argv[4].v_nmembs; |
| 604 | 604 | if (argv[4].v_size != argsz[4]) |
| 605 | 605 | goto out; |
| 606 | + if (nsegs > UINT_MAX / sizeof(__u64)) | |
| 607 | + goto out; | |
| 606 | 608 | |
| 607 | 609 | /* |
| 608 | 610 | * argv[4] points to segment numbers this ioctl cleans. We |
| @@ -330,8 +330,17 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone, · 329 unmodified lines | ||
| 330 | 330 | continue; |
| 331 | 331 | nr_scanned++; |
| 332 | 332 | |
| 333 | − /* Get the page and skip if free */ | |
| 333 | + /* | |
| 334 | + * Get the page and ensure the page is within the same zone. | |
| 335 | + * See the comment in isolate_freepages about overlapping | |
| 336 | + * nodes. It is deliberate that the new zone lock is not taken | |
| 337 | + * as memory compaction should not move pages between nodes. | |
| 338 | + */ | |
| 334 | 339 | page = pfn_to_page(low_pfn); |
| 340 | + if (page_zone(page) != zone) | |
| 341 | + continue; | |
| 342 | + | |
| 343 | + /* Skip if free */ | |
| 335 | 344 | if (PageBuddy(page)) |
| 336 | 345 | continue; |
| 337 | 346 | |
| @@ -2083,7 +2083,7 @@ static void collect_mm_slot(struct mm_slot *mm_slot) · 2082 unmodified lines | ||
| 2083 | 2083 | { |
| 2084 | 2084 | struct mm_struct *mm = mm_slot->mm; |
| 2085 | 2085 | |
| 2086 | − VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock)); | |
| 2086 | + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock)); | |
| 2087 | 2087 | |
| 2088 | 2088 | if (khugepaged_test_exit(mm)) { |
| 2089 | 2089 | /* free mm_slot */ |
| @@ -2113,7 +2113,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages, · 23 unmodified lines | ||
| 2113 | 2113 | int progress = 0; |
| 2114 | 2114 | |
| 2115 | 2115 | VM_BUG_ON(!pages); |
| 2116 | − VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock)); | |
| 2116 | + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock)); | |
| 2117 | 2117 | |
| 2118 | 2118 | if (khugepaged_scan.mm_slot) |
| 2119 | 2119 | mm_slot = khugepaged_scan.mm_slot; |
| @@ -659,7 +659,7 @@ void lru_add_page_tail(struct zone* zone, · 658 unmodified lines | ||
| 659 | 659 | VM_BUG_ON(!PageHead(page)); |
| 660 | 660 | VM_BUG_ON(PageCompound(page_tail)); |
| 661 | 661 | VM_BUG_ON(PageLRU(page_tail)); |
| 662 | − VM_BUG_ON(!spin_is_locked(&zone->lru_lock)); | |
| 662 | + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&zone->lru_lock)); | |
| 663 | 663 | |
| 664 | 664 | SetPageLRU(page_tail); |
| 665 | 665 | |