Why was the below patch marked for -stable trees, as the function,
fprop_new_period() isn't even in 3.5 or older kernels?  Was it called
something else before?

thanks,

greg k-h


On Tue, Sep 25, 2012 at 05:54:24PM -0400, Gregs git-bot wrote:
> commit: b5bd6a0e5fa8c0376d9746c566fe3daaa51ec825
> From: Jan Kara <[email protected]>
> Date: Mon, 24 Sep 2012 17:17:35 -0700
> Subject: lib/flex_proportions.c: fix corruption of denominator in flexible 
> proportions
> 
> When racing with CPU hotplug, percpu_counter_sum() can return negative
> values for the number of observed events.
> 
> This confuses fprop_new_period(), which uses unsigned type and as a
> result number of events is set to big *positive* number.  From that
> moment on, things go pear shaped and can result e.g.  in division by
> zero as denominator is later truncated to 32-bits.
> 
> This bug causes a divide-by-zero oops in bdi_dirty_limit() in Borislav's
> 3.6.0-rc6 based kernel.
> 
> Fix the issue by using a signed type in fprop_new_period().  That makes
> us bail out from the function without doing anything (mistakenly)
> thinking there are no events to age.  That makes aging somewhat
> inaccurate but getting accurate data would be rather hard.
> 
> Signed-off-by: Jan Kara <[email protected]>
> Reported-by: Borislav Petkov <[email protected]>
> Reported-by: Srivatsa S. Bhat <[email protected]>
> Cc: Wu Fengguang <[email protected]>
> Cc: Peter Zijlstra <[email protected]>
> Cc: <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> Signed-off-by: Linus Torvalds <[email protected]>
> ---
>  lib/flex_proportions.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/flex_proportions.c b/lib/flex_proportions.c
> index c785554..ebf3bac 100644
> --- a/lib/flex_proportions.c
> +++ b/lib/flex_proportions.c
> @@ -62,7 +62,7 @@ void fprop_global_destroy(struct fprop_global *p)
>   */
>  bool fprop_new_period(struct fprop_global *p, int periods)
>  {
> -     u64 events;
> +     s64 events;
>       unsigned long flags;
>  
>       local_irq_save(flags);
> -- 
> 1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to