[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-client.c ...



CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	jbrassow sourceware org	2006-06-29 19:48:01

Modified files:
	cmirror-kernel/src: dm-cmirror-client.c dm-cmirror-common.h 
	                    dm-cmirror-server.c 

Log message:
	- fix for bug 197263
	
	The cluster mirror 'flush' logging function was still behaving the
	way it used to before the changes to the kernel that allowed it to
	receive the status of a log flush from 'flush'.  This could result
	in a indefinite suspension of the mirror on which a log device had
	failed.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-client.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.19&r2=1.1.2.20
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-common.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.7&r2=1.1.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-server.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.11&r2=1.1.2.12

--- cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c	2006/06/15 19:48:00	1.1.2.19
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c	2006/06/29 19:48:01	1.1.2.20
@@ -202,7 +202,7 @@
 	lc = (struct log_c *) log->context;
 	lc->log_dev = dev;
 	lc->log_dev_failed = 0;
-	init_completion(&lc->failure_completion);
+	/* init_completion(&lc->failure_completion); */
 
 	/* setup the disk header fields */
 	lc->header_location.bdev = lc->log_dev->bdev;
@@ -757,22 +757,23 @@
 {
 	struct log_c *lc = (struct log_c *) log->context;
 
+	/*
 	atomic_set(&lc->suspended, 1);
-	
+
 	if (lc->log_dev && lc->log_dev_failed)
 		complete(&lc->failure_completion);
-	else {
-		while (1) {
-			spin_lock(&region_state_lock);
-			if (list_empty(&clear_region_list)) {
-				spin_unlock(&region_state_lock);
-				break;
-			}
+	else
+	*/
+	while (1) {
+		spin_lock(&region_state_lock);
+		if (list_empty(&clear_region_list)) {
 			spin_unlock(&region_state_lock);
-
-			/* Just an unnessesary call to clear out regions */
-			consult_server(lc, 0, LRT_IN_SYNC, NULL);
+			break;
 		}
+		spin_unlock(&region_state_lock);
+
+		/* Just an unnessesary call to clear out regions */
+		consult_server(lc, 0, LRT_IN_SYNC, NULL);
 	}
 
 	return 0;
@@ -787,7 +788,7 @@
 
 	lc->sync_search = 0;
 	resume_server_requests();
-	atomic_set(&lc->suspended, 0);
+	/* atomic_set(&lc->suspended, 0); */
 
 	return 0;
 }
@@ -847,8 +848,10 @@
 
 static int cluster_flush(struct dirty_log *log)
 {
+	struct log_c *lc = (struct log_c *) log->context;
+
 	/* FIXME:  flush all clear_region requests to server */
-	return 0;
+	return (lc->log_dev_failed) ? -EIO : 0;
 }
 
 static void cluster_mark_region(struct dirty_log *log, region_t region)
@@ -909,14 +912,20 @@
 		DMWARN("unable to get server (%u) to mark region (%Lu)",
 		       lc->server_id, region);
 		DMWARN("Reason :: %d", error);
+		if (error == -EIO) {
+			lc->log_dev_failed = 1;
+			break;
+		}
 	}
 
 	if (lc->log_dev_failed) {
 		DMERR("Write failed on mirror log device, %s",
 		      lc->log_dev->name);
 		dm_table_event(lc->ti->table);
+		/*
 		if (!atomic_read(&lc->suspended))
 			wait_for_completion(&lc->failure_completion);
+		*/
 	}
 	return;
 }
--- cluster/cmirror-kernel/src/Attic/dm-cmirror-common.h	2006/02/16 18:34:05	1.1.2.7
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-common.h	2006/06/29 19:48:01	1.1.2.8
@@ -110,8 +110,10 @@
 	 * Disk log fields
 	 */
 	int log_dev_failed;
+	/*
 	atomic_t suspended;
 	struct completion failure_completion;
+	*/
 	struct dm_dev *log_dev;
 	struct log_header header;
 
--- cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c	2006/06/27 20:24:59	1.1.2.11
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c	2006/06/29 19:48:01	1.1.2.12
@@ -519,7 +519,7 @@
 		mempool_free(new, region_user_pool);
 	}
 
-	return 0;
+	return (lc->log_dev_failed) ? -EIO : 0;
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]