From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932392AbXBPPGH (ORCPT ); Fri, 16 Feb 2007 10:06:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932394AbXBPPGG (ORCPT ); Fri, 16 Feb 2007 10:06:06 -0500 Received: from mx1.redhat.com ([66.187.233.31]:43650 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932392AbXBPPGF (ORCPT ); Fri, 16 Feb 2007 10:06:05 -0500 From: David Howells In-Reply-To: <45D5B483.3020502@hitachi.com> References: <45D5B483.3020502@hitachi.com> <45D5B2E3.3030607@hitachi.com> To: "Kawai, Hidehiro" Cc: Andrew Morton , kernel list , Pavel Machek , Robin Holt , Alan Cox , Masami Hiramatsu , sugita , Satoshi OSHIMA , "Hideo AOKI@redhat" Subject: Re: [PATCH 3/4] coredump: ELF-FDPIC: enable to omit anonymous shared memory X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.0.50 Date: Fri, 16 Feb 2007 15:05:35 +0000 Message-ID: <20368.1171638335@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Kawai, Hidehiro wrote: > static int elf_fdpic_dump_segments(struct file *file, struct mm_struct *mm, > - size_t *size, unsigned long *limit) > + size_t *size, unsigned long *limit, > + unsigned int omit_anon_shared) Why are you passing it as an extra argument when you could just use mm->coredump_omit_anon_shared here: > + if (!maydump(vma, omit_anon_shared)) And here: > + phdr.p_filesz = maydump(vma, omit_anon_shared) ? sz : 0; Actually, I think I would just pass the mm pointer you have into maydump() and let that dereference it here: > + if (omit_anon_shared) { which would then be: if (mm->coredump_omit_anon_shared) { Then the calls to maydump() would be: if (!maydump(vma, mm)) and: phdr.p_filesz = maydump(vma, current->mm) ? sz : 0; I wouldn't worry, were I you, about the setting changing whilst it's being used. If you are worried about that, you can probably do some locking against that. David