|
Lines 1352-1357
int expand_stack(struct vm_area_struct *
Link Here
|
| 1352 |
*/ |
1352 |
*/ |
| 1353 |
address += 4 + PAGE_SIZE - 1; |
1353 |
address += 4 + PAGE_SIZE - 1; |
| 1354 |
address &= PAGE_MASK; |
1354 |
address &= PAGE_MASK; |
|
|
1355 |
|
| 1356 |
/* already expanded while waiting for anon_vma lock? */ |
| 1357 |
if (vma->vm_end >= address) { |
| 1358 |
anon_vma_unlock(vma); |
| 1359 |
return 0; |
| 1360 |
} |
| 1361 |
|
| 1355 |
grow = (address - vma->vm_end) >> PAGE_SHIFT; |
1362 |
grow = (address - vma->vm_end) >> PAGE_SHIFT; |
| 1356 |
|
1363 |
|
| 1357 |
/* Overcommit.. */ |
1364 |
/* Overcommit.. */ |
|
Lines 1409-1414
int expand_stack(struct vm_area_struct *
Link Here
|
| 1409 |
return -ENOMEM; |
1416 |
return -ENOMEM; |
| 1410 |
anon_vma_lock(vma); |
1417 |
anon_vma_lock(vma); |
| 1411 |
|
1418 |
|
|
|
1419 |
/* already expanded while waiting for anon_vma lock? */ |
| 1420 |
if (vma->vm_start <= address) { |
| 1421 |
anon_vma_unlock(vma); |
| 1422 |
return 0; |
| 1423 |
} |
| 1424 |
|
| 1412 |
/* |
1425 |
/* |
| 1413 |
* vma->vm_start/vm_end cannot change under us because the caller |
1426 |
* vma->vm_start/vm_end cannot change under us because the caller |
| 1414 |
* is required to hold the mmap_sem in read mode. We need the |
1427 |
* is required to hold the mmap_sem in read mode. We need the |