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

Hatayama, Daisuke d.hatayama at jp.fujitsu.com
Tue Nov 13 03:49:11 EST 2012


> -----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.

Thanks.
HATAYAMA, Daisuke




More information about the kexec mailing list