Hi,
Thank you for your kind comments.
I'm sorry for my late reply.
Andrew Morton wrote:
I understand. Thank you for your suggestion. I'll reply about it in
another mail, but it may take a few days.
Previous v3 patchset does what you suggest, and here are links to the
patches:
[PATCH 2/4] coredump: ELF: enable to omit anonymous shared memory
http://lkml.org/lkml/2007/2/16/156
[PATCH 3/4] coredump: ELF-FDPIC: enable to omit anonymous shared memory
http://lkml.org/lkml/2007/2/16/157
However, there was an opposite opinion. To pass the flag status, I
added omit_anon_shared argument to elf_fdpic_dump_segments(). Then,
David pointed that the argument was unncecessary, because the function
also receives mm_struct *mm which includes coredump_omit_anon_shared.
But mm->coredump_omit_anon_shared can be changed while core dumping, and
it may causes the core file to be corrupted. So in v4 patchset I used
r/w semaphore to prevent mm->coredump_omit_anon_shared from being changed.
If I add an addtional argument to elf_fdpic_dump_segments() again, I
have to explain it to David. I'll tell him that removing mm argument
from the function will be a solution since it refers current->mm directly
and the mm argument is never used.
OK. I'll do it in the next version.
I understood. Since I had done so initially, I'll revert it to.
There are people who wish to dump VMAs which are not dumped by default.
Taking this into account, some bits of core_dumpfilter will be set by
default. This means users have to be aware of the default bitmask
when they change the bitmask. Perhaps changing the bitmask requires
3 steps:
1. read the default bitmask
2. change bits of the mask
3. write it to the proc entry
So I think it is better if we provide /proc/pid/core_flags (default:
all bits are 0) instead of core_dumpfilter. With this interface,
users who use only one bit of the bitmask (this will be a common case)
just have to write 2^n to the proc entry. It takes only one step:
1. write a value to the proc entry
If we can implement at the same cost, core_flags will be better
because it is useful for users. What would you think about that?
By the way, Robin Holt wrote as follows:
Do you think Robin's suggestion is acceptable?
Best regards,
--
Hidehiro Kawai
Hitachi, Ltd., Systems Development Laboratory
-