md/raid5: Cleanup cpu hotplug notifier
authorAnna-Maria Gleixner <anna-maria@linutronix.de>
Wed, 16 Mar 2016 08:25:23 +0000 (09:25 +0100)
committerShaohua Li <shli@fb.com>
Thu, 17 Mar 2016 21:30:15 +0000 (14:30 -0700)
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 <shli@kernel.org>
CC: linux-raid@vger.kernel.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid5.c

index 31ac0f0bf86f64fe6e31286eaa9d617fd2cc7dc3..8ab8b65e17413e4a015aab5e073728fd23e21b47 100644 (file)
@@ -6381,6 +6381,8 @@ static int raid456_cpu_notify(struct notifier_block *nfb, unsigned long action,
                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: