Skip to contentSkip to conversation

dm: suspend: fix error path

PATCH In review Alasdair G Kergon 1 participant 1 message Nov 7, 2006 Device mapper

lore
Share & tools
lore

Alasdair G Kergon

author maintainer
#0 lore raw

PATCH 2/5 dm: suspend: fix error path

If the device is already suspended, just return the error and skip the code that would incorrectly wipe md->suspended_bdev.

(This isn't currently a problem because existing code avoids calling this function if the device is already suspended.)

drivers/md/dm.c +3 -1
Index: linux-2.6.19-rc4/drivers/md/dm.c
===================================================================
@@ -1285,7 +1285,7 @@ int dm_suspend(struct mapped_device *md,
 	down(&md->suspend_lock);
 
 	if (dm_suspended(md))
-		goto out;
+		goto out_unlock;
 
 	map = dm_get_table(md);
 
@@ -1361,6 +1361,8 @@ out:
 	}
 
 	dm_table_put(map);
+
+out_unlock:
 	up(&md->suspend_lock);
 	return r;
 }