All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atsushi Kumagai <ats-kumagai@wm.jp.nec.com>
To: Martin Wilck <mwilck@suse.de>, Petr Tesarik <ptesarik@suse.cz>
Cc: "kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: RE: [PATCH 3/3] close_dump_bitmap: simplify logic
Date: Tue, 16 Aug 2016 00:37:09 +0000	[thread overview]
Message-ID: <0910DD04CBD6DE4193FCF86B9C00BE9701E5CE94@BPXM01GP.gisp.nec.co.jp> (raw)
In-Reply-To: <1470836145.3194.31.camel@suse.de>

>> > The boolean expression replicates the logic of open_dump_bitmap().
>> > It's simpler and less error-prone to simply check if fd_bitmap is
>> > valid.
>> >
>> > Signed-off-by: Martin Wilck <mwilck@suse.de>
>> > ---
>> >  makedumpfile.c | 3 +--
>> >  1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>> > diff --git a/makedumpfile.c b/makedumpfile.c
>> > index 43278f1..771ab7c 100644
>> > --- a/makedumpfile.c
>> > +++ b/makedumpfile.c
>> > @@ -8579,8 +8579,7 @@ close_dump_file(void)
>> >  void
>> >  close_dump_bitmap(void)
>> >  {
>> > -	if (!info->working_dir && !info->flag_reassemble && !info-
>> > >flag_refiltering
>> > -	    && !info->flag_sadump && !info->flag_mem_usage)
>> > +	if (!info->fd_bitmap)
>>
>> Strictly speaking, zero is a valid FD. I can see that it is highly
>> unlikely to be the bitmap FD, but it would be a nice cleanup to
>> initialize fd_bitmap to a negative number and check info->fd_bitmap <
>> 0.
>> I'm just not sure where to put the initializition...
>
>
>> > OTOH I know I'm asking you to fix something that you didn't break.
>
>I had the same thought, and the same excuse not to address it in this
>patch set. If you grep makedumpfile.c for "fd_bitmap", you'll see many
>checks like "if (info->fd_bitmap)". I just followed that pattern for
>now.

I see, it would be better to make the checks strict on this occasion.
So, could you work for that cleanup before your three patches as an
additional cleanup patch ?


Thanks,
Atsushi Kumagai
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2016-08-16  0:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 12:56 [PATCH 0/3] makedumpfile: fix segfault with -X in XEN environment Martin Wilck
2016-08-10 12:56 ` [PATCH 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Martin Wilck
2016-08-10 12:56 ` [PATCH 2/3] move call to open_dump_bitmap() to after call to initial() Martin Wilck
2016-08-10 12:56 ` [PATCH 3/3] close_dump_bitmap: simplify logic Martin Wilck
2016-08-10 13:08   ` Petr Tesarik
2016-08-10 13:35     ` Martin Wilck
2016-08-16  0:37       ` Atsushi Kumagai [this message]
2016-08-16  5:59         ` Petr Tesarik
2016-08-17  7:37           ` Martin Wilck
2016-09-06  8:22             ` [PATCH] Cleanup: Use a negative number for uninitialized file descriptors Petr Tesarik
2016-09-09  6:27               ` Atsushi Kumagai
2016-09-09  7:31                 ` Petr Tesarik
2016-09-09  8:11                   ` [PATCH v2] " Petr Tesarik
2016-09-12  8:17                     ` Atsushi Kumagai
2016-09-14 10:17                       ` [PATCH v2 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Martin Wilck
2016-09-14 10:17                         ` [PATCH v2 2/3] move call to open_dump_bitmap() to after call to initial() Martin Wilck
2016-09-14 10:17                         ` [PATCH v2 3/3] close_dump_bitmap: simplify logic Martin Wilck
2016-09-14 11:50                           ` [PATCH v3 " Martin Wilck
2016-09-20  9:43                             ` Atsushi Kumagai
2016-09-20 10:31                               ` Martin Wilck
2016-09-20 10:33                               ` [PATCH v3 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Martin Wilck
2016-09-20 10:33                                 ` [PATCH v3 2/3] move call to open_dump_bitmap() to after call to initial() Martin Wilck
2016-09-20 10:33                                 ` [PATCH v3 3/3] close_dump_bitmap: simplify logic Martin Wilck
2016-09-21  6:29                                 ` [PATCH v3 1/3] open_dump_bitmap: open bitmap file in non-cyclic case Atsushi Kumagai

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=0910DD04CBD6DE4193FCF86B9C00BE9701E5CE94@BPXM01GP.gisp.nec.co.jp \
    --to=ats-kumagai@wm.jp.nec.com \
    --cc=kexec@lists.infradead.org \
    --cc=mwilck@suse.de \
    --cc=ptesarik@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.