[PATCH 10/10] Print warning about cyclic buffer overrun if it can happen

Atsushi Kumagai kumagai-atsushi at mxc.nes.nec.co.jp
Tue Nov 13 22:47:42 EST 2012


Hello HATAYAMA-san,

On Tue, 13 Nov 2012 08:49:11 +0000
"Hatayama, Daisuke" <d.hatayama at jp.fujitsu.com> wrote:

> > -----Original Message-----
> > From: Atsushi Kumagai [mailto:kumagai-atsushi at mxc.nes.nec.co.jp]
> > Sent: Tuesday, November 13, 2012 4:56 PM
> > To: Hatayama, Daisuke
> > Cc: kexec at lists.infradead.org
> > Subject: Re: [PATCH 10/10] Print warning about cyclic buffer overrun if
> > it can happen
> > 
> > Hello HATAYAMA-san,
> > 
> > On Thu, 08 Nov 2012 18:49:00 +0900
> > HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com> wrote:
> > 
> > > Clearling bits on cyclic buffer can overrun the cyclic buffer
> > > according to some combination of MAX_ORDER and cyclic buffer size.
> > >
> > > This patch warns this possibility but continues processing.
> > >
> > > Signed-off-by: HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com>
> > > ---
> > 
> > Thank you for pointing it out.
> > 
> > v1.5.1-rc will calculate the cyclic buffer size automatically and this
> > issue can happen even if MAX_ORDER is 11, so this patch is useful.
> > 
> > I'll try to resolve this issue essentially in v1.5.2.
> > 
> 
> Instead of the check, how about the following?
> 
>   info->bufsize_cyclic = round(info->bufsize_cyclic,
>                                roundup(max_order_nr_pages,
>                                        BITPERBYTE));
> 
> This chooses the largest buffer size from the sizes smaller than
> info->bufsize_cyclic fitting into max_order size.

It looks good, please change this patch as the above in v2.


Thanks
Atsushi Kumagai



More information about the kexec mailing list