Skip to contentSkip to conversation

md/raid10: unlock on error path in raid10_start_reshape()

PATCH In review Dan Carpenter 2 participants 2 messages May 17, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 md/raid10: unlock on error path in raid10_start_reshape()

We need to unlock and enable IRQs before returning here.

drivers/md/raid10.c +1 -0
index e8ed1d8..ba7290f 100644
@@ -3918,6 +3918,7 @@ static int raid10_start_reshape(struct mddev *mddev)
 	if (mddev->reshape_backwards) {
 		sector_t size = raid10_size(mddev, 0, 0);
 		if (size < mddev->array_sectors) {
+			spin_unlock_irq(&conf->device_lock);
 			printk(KERN_ERR "md/raid10:%s: array size must be reduce before number of disks\n",
 			       mdname(mddev));
 			return -EINVAL;
#1 lore raw
Quoted 9 lines · On Thu, 17 May 2012 09:49:11 +0300 Dan Carpenter <[email protected]>…

We need to unlock and enable IRQs before returning here.

drivers/md/raid10.c +0 -0
index e8ed1d8..ba7290f 100644

drivers/md/raid10.c static int raid10_start_reshape(struct mddev *mddev) · line 3924

Quoted 7 lines
drivers/md/raid10.c +1 -0
@@ -3918,6 +3918,7 @@ static int raid10_start_reshape(struct mddev *mddev)
 	if (mddev->reshape_backwards) {
 		sector_t size = raid10_size(mddev, 0, 0);
 		if (size < mddev->array_sectors) {
+			spin_unlock_irq(&conf->device_lock);
 			printk(KERN_ERR "md/raid10:%s: array size must be reduce before number of disks\n",
 			       mdname(mddev));
 			return -EINVAL;

Hi Dan,
thanks heaps for this!!
I've merged the change into the original patch with suitable attribution. The result should get into tomorrows linux-next.

Thanks,
NeilBrown