View | Details | Raw Unified | Return to bug 64652
Collapse All | Expand All

(-)linux-2.6.10-mm1.orig/mm/mmap.c (+13 lines)
Lines 1373-1378 Link Here
1373
	 */
1373
	 */
1374
	address += 4 + PAGE_SIZE - 1;
1374
	address += 4 + PAGE_SIZE - 1;
1375
	address &= PAGE_MASK;
1375
	address &= PAGE_MASK;
1376
1377
	/* already expanded while waiting for anon_vma lock? */
1378
	if (vma->vm_start >= address) {
1379
		anon_vma_unlock(vma);
1380
		return 0;
1381
	}
1382
1376
	grow = (address - vma->vm_end) >> PAGE_SHIFT;
1383
	grow = (address - vma->vm_end) >> PAGE_SHIFT;
1377
1384
1378
	/* Overcommit.. */
1385
	/* Overcommit.. */
Lines 1432-1437 Link Here
1432
		return -ENOMEM;
1439
		return -ENOMEM;
1433
	anon_vma_lock(vma);
1440
	anon_vma_lock(vma);
1434
1441
1442
	/* already expanded while waiting for anon_vma lock? */
1443
	if (vma->vm_start <= address) {
1444
		anon_vma_unlock(vma);
1445
		return 0;
1446
	}
1447
1435
	/*
1448
	/*
1436
	 * vma->vm_start/vm_end cannot change under us because the caller
1449
	 * vma->vm_start/vm_end cannot change under us because the caller
1437
	 * is required to hold the mmap_sem in read mode.  We need the
1450
	 * is required to hold the mmap_sem in read mode.  We need the

Return to bug 64652