Skip to contentSkip to conversation

mirroring: [patch 6 of 6] device failure tolerance

PATCH Jonathan E Brassow 2 participants 2 messages Jun 30, 2005 – Jul 1, 2005 Device mapper

lore
Share & tools
lore
#0 lore raw

This patch changes how suspend works in dm.c (dm_suspend). As a result, it breaks multipath. It is necessary for cluster mirroring to ensure that a suspend happens before other nodes have a chance at getting an inconsistent read.

brassow

drivers/md/dm.c +4 -4
diff -urN linux-2.6.12-00005/drivers/md/dm.c linux-2.6.12-00006/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);
 
 	/*
#1 lore raw
Quoted 4 lines · Jon Brassow

This patch changes how suspend works in dm.c (dm_suspend). As a result, it breaks multipath. It is necessary for cluster mirroring to ensure that a suspend happens before other nodes have a chance at getting an inconsistent read.

Proposing something like:
ftp://sources.redhat.com/pub/dm/patches/2.6-unstable/editing/patches/00016.patch
(not compile-tested)

Can you find a way to make it cope without an 'undo presuspend' function to call on error? It might be OK to add a call to 'resume' on error if you can make that work correctly when not preceded by postsuspend.

Alasdair