From: Daisuke HATAYAMA <d.hatayama@jp.fujitsu.com>
To: xiyou.wangcong@gmail.com
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
jdike@addtoit.com, tony.luck@intel.com, mhiramat@redhat.com
Subject: Re: [RFC, PATCH 4/4] elf_core_dump(): Add extended numbering support
Date: Wed, 16 Dec 2009 11:24:02 +0900 (JST) [thread overview]
Message-ID: <20091216.112402.226798335.d.hatayama@jp.fujitsu.com> (raw)
In-Reply-To: <2375c9f90912150027h2435fad9yc35bc360f743d7a6@mail.gmail.com>
I agree with two of three cleanup ideas, but the last.
> > @@ -2079,11 +2139,19 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, un
> > if (!elf_core_write_extra_data(file, &size, limit))
> > goto end_coredump;
> >
> > + if (e_phnum == PN_XNUM) {
> > + size += sizeof(*shdr4extnum);
> > + if (size > limit
> > + || !dump_write(file, shdr4extnum, sizeof(*shdr4extnum)))
> > + goto end_coredump;
> > + }
> > +
> > end_coredump:
There are two reasons I wrote like this.
First, the code like
if (size > limit || !dump_write(file, obj, sizeof(*obj)))
goto end_coredump;
is used as the common idiom in thourghout elf_core_dump(). Not
writing goto only at the last use seems unnatural for me.
Second, there is a possibility that new writing operation for section
header table will be added. If the goto is removed now, the patch
writer must rewrite it again.
Thanks for your comments.
next prev parent reply other threads:[~2009-12-16 2:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-15 2:41 Daisuke HATAYAMA
2009-12-15 7:56 ` Américo Wang
2009-12-15 8:34 ` Américo Wang
2009-12-15 8:27 ` Américo Wang
2009-12-16 2:24 ` Daisuke HATAYAMA [this message]
2009-12-15 14:09 ` Andi Kleen
2009-12-16 0:30 ` KOSAKI Motohiro
2009-12-16 2:32 ` Daisuke HATAYAMA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091216.112402.226798335.d.hatayama@jp.fujitsu.com \
--to=d.hatayama@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@redhat.com \
--cc=tony.luck@intel.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®