2016-03-16 08:26:09

by Anna-Maria Behnsen

[permalink] [raw]
Subject: [PATCH] md/raid5: Cleanup cpu hotplug notifier

The raid456_cpu_notify() hotplug callback lacks handling of the
CPU_UP_CANCELED case. That means if CPU_UP_PREPARE fails, the scratch
buffer is leaked.

Add handling for CPU_UP_CANCELED[_FROZEN] hotplug notifier transitions
to free the scratch buffer.

CC: Shaohua Li <[email protected]>
CC: [email protected]
Signed-off-by: Anna-Maria Gleixner <[email protected]>
---
drivers/md/raid5.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6376,6 +6376,8 @@ static int raid456_cpu_notify(struct not
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
+ case CPU_UP_CANCELED:
+ case CPU_UP_CANCELED_FROZEN:
free_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu));
break;
default:


2016-03-16 17:11:42

by Shaohua Li

[permalink] [raw]
Subject: Re: [PATCH] md/raid5: Cleanup cpu hotplug notifier

On Wed, Mar 16, 2016 at 09:25:23AM +0100, Anna-Maria Gleixner wrote:
> The raid456_cpu_notify() hotplug callback lacks handling of the
> CPU_UP_CANCELED case. That means if CPU_UP_PREPARE fails, the scratch
> buffer is leaked.
>
> Add handling for CPU_UP_CANCELED[_FROZEN] hotplug notifier transitions
> to free the scratch buffer.
>
> CC: Shaohua Li <[email protected]>
> CC: [email protected]
> Signed-off-by: Anna-Maria Gleixner <[email protected]>

Applied, thanks!