Commit 6280dd0f authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

Make core-dumps have all the relevant regions in it.

Based on input from Roland McGrath and Hugh Dickins.

This simplifies the logic, and takes advantage of the
"new" VM information in the form of vma->anon_vma.
parent 172b5487
...@@ -1054,22 +1054,14 @@ static int dump_seek(struct file *file, off_t off) ...@@ -1054,22 +1054,14 @@ static int dump_seek(struct file *file, off_t off)
*/ */
static int maydump(struct vm_area_struct *vma) static int maydump(struct vm_area_struct *vma)
{ {
/* /* Do not dump I/O mapped devices, shared memory, or special mappings */
* If we may not read the contents, don't allow us to dump if (vma->vm_flags & (VM_IO | VM_SHARED | VM_RESERVED))
* them either. "dump_write()" can't handle it anyway.
*/
if (!(vma->vm_flags & VM_READ))
return 0; return 0;
/* Do not dump I/O mapped devices! -DaveM */ /* If it hasn't been written to, don't write it out */
if (vma->vm_flags & VM_IO) if (!vma->anon_vma)
return 0;
#if 1
if (vma->vm_flags & (VM_WRITE|VM_GROWSUP|VM_GROWSDOWN))
return 1;
if (vma->vm_flags & (VM_READ|VM_EXEC|VM_EXECUTABLE|VM_SHARED))
return 0; return 0;
#endif
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment