Skip to contentSkip to conversation

mirroring: [patch 7 of 8] device failure tolerance

PATCH Jonathan E Brassow 1 participant 1 message Jun 29, 2005 Device mapper

lore
Share & tools
lore
#0 lore raw

This patch is necessary _only_ to enable cluster capable mirrors. It also requires changes to multipath if it is to be included. You could safely running mirroring on a single machine without this patch.

In cluster mirroring, if a device failure occurs, an end_io can not be issued until a suspend has taken place. This is because another machine could still be able to see the device that the first machine got a write failure on, and read it - getting inconsistent results. Because the mirror is waiting for a suspend before issuing the end_io's, the lock_fs call in dm_suspend must come after the presuspend.

brassow

drivers/md/dm.c +4 -4
diff -urN linux-2.6.12-002/drivers/md/dm.c linux-2.6.12-003/drivers/md/dm.c
@@ -1055,14 +1055,14 @@
 	if (test_bit(DMF_BLOCK_IO, &md->flags))
 		goto out_read_unlock;
 
-	error = __lock_fs(md);
-	if (error)
-		goto out_read_unlock;
-
 	map = dm_get_table(md);
 	if (map)
 		dm_table_presuspend_targets(map);
 
+	error = __lock_fs(md);
+	if (error)
+		goto out_read_unlock;
+
 	up_read(&md->lock);
 
 	/*