Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: piliu <piliu@redhat.com>
To: Kazuhito Hagio <k-hagio@ab.jp.nec.com>,
	"kexec@lists.infradead.org" <kexec@lists.infradead.org>
Subject: Re: [PATCH] makedumpfile: assign bitmap2 fd for sub process during refiltering
Date: Mon, 9 Dec 2019 14:05:54 +0800	[thread overview]
Message-ID: <0d793e2d-6698-6543-13de-a3de8732df75@redhat.com> (raw)
In-Reply-To: <4AE2DC15AC0B8543882A74EA0D43DBEC035977E6@BPXM09GP.gisp.nec.co.jp>



On 12/07/2019 06:11 AM, Kazuhito Hagio wrote:
> Hi Pingfan,
> 
>> -----Original Message-----
>> In refiltering mode, each sub process inherits bitmap2->fd from parent.
>> Then they lseek()/read() on the same fd, which means that they interference
>> with each other.
>>
>> This breaks the purpose of SPLITTING_FD_BITMAP(i) for each sub process.
>> Fix it by assigning a sub process dedicated fd to bitmap2->fd.
>>
>> Signed-off-by: Pingfan Liu <piliu@redhat.com>
> 
> Thanks for the patch.
> I'm still reading the code, but it might be better to apply this to bitmap1->fd
> as well?  see you next week..
Yes. Although during my test, bitmap1 is not touched, but it is a
reasonable step to against any future bug.

Thanks,
Pingfan
> 
> Thanks,
> Kazu
> 
>> ---
>>  makedumpfile.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/makedumpfile.c b/makedumpfile.c
>> index d76a435..1dc8640 100644
>> --- a/makedumpfile.c
>> +++ b/makedumpfile.c
>> @@ -8857,7 +8857,8 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
>>  	if (info->flag_cyclic) {
>>  		if (!prepare_bitmap2_buffer())
>>  			return FALSE;
>> -	}
>> +	} else if (info->flag_refiltering)
>> +		info->bitmap2->fd = info->fd_bitmap;
>>
>>  	/*
>>  	 * Write pages and bitmap cyclically.
>> --
>> 2.7.5
>>
> 
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
> 


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2019-12-09  6:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03  7:37 [PATCH] makedumpfile: assign bitmap2 fd for sub process during refiltering Pingfan Liu
2019-12-06 22:11 ` Kazuhito Hagio
2019-12-09  6:05   ` piliu [this message]
2019-12-09 20:10     ` Kazuhito Hagio
2019-12-11  7:41       ` piliu
2019-12-11 17:44         ` Kazuhito Hagio
2019-12-12  1:40           ` piliu

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=0d793e2d-6698-6543-13de-a3de8732df75@redhat.com \
    --to=piliu@redhat.com \
    --cc=k-hagio@ab.jp.nec.com \
    --cc=kexec@lists.infradead.org \
    /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