cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-client.c ...
Date: 29 Jun 2006 19:49:33 -0000	[thread overview]
Message-ID: <20060629194933.2430.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	STABLE
Changes by:	jbrassow at sourceware.org	2006-06-29 19:49:32

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=STABLE&r1=1.1.4.2&r2=1.1.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-common.h.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.4.2&r2=1.1.4.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-server.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.4.2&r2=1.1.4.3

--- cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c	2006/06/27 20:19:53	1.1.4.2
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c	2006/06/29 19:49:32	1.1.4.3
@@ -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;
 }
@@ -833,8 +834,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)
@@ -895,14 +898,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/06/27 20:19:53	1.1.4.2
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-common.h	2006/06/29 19:49:32	1.1.4.3
@@ -111,8 +111,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:19:53	1.1.4.2
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c	2006/06/29 19:49:32	1.1.4.3
@@ -508,7 +508,7 @@
 		mempool_free(new, region_user_pool);
 	}
 
-	return 0;
+	return (lc->log_dev_failed) ? -EIO : 0;
 }
 
 



             reply	other threads:[~2006-06-29 19:49 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 19:49 jbrassow [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-03 19:02 [Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-client.c jbrassow
2007-09-27 20:31 jbrassow
2007-09-26  3:15 jbrassow
2007-09-21 20:07 jbrassow
2007-09-13 15:24 jbrassow
2007-07-11 16:18 jbrassow
2007-04-26 16:55 jbrassow
2007-04-26 16:54 jbrassow
2007-04-24 20:10 jbrassow
2007-04-24 20:08 jbrassow
2007-04-10  7:13 jbrassow
2007-04-10  7:12 jbrassow
2007-04-05 21:33 jbrassow
2007-04-05 21:32 jbrassow
2007-04-03 18:23 jbrassow
2007-04-03 18:21 jbrassow
2007-03-22 22:34 jbrassow
2007-03-22 22:22 jbrassow
2007-03-14  4:28 jbrassow
2007-02-26 17:38 jbrassow
2007-02-20 19:35 jbrassow
2007-02-19 16:29 jbrassow
2007-02-14 17:44 jbrassow
2007-02-02 17:22 jbrassow
2007-01-08 19:28 jbrassow
2006-12-07 18:58 jbrassow
2006-09-05 17:50 jbrassow
2006-09-05 17:48 jbrassow
2006-07-27 23:11 jbrassow
2006-07-27 23:11 jbrassow
2006-07-22 22:19 jbrassow
2006-07-22 22:19 jbrassow
2006-07-22 22:12 jbrassow
2006-06-29 19:48 jbrassow
2006-06-29 19:46 jbrassow
2006-06-27 20:19 jbrassow
2006-06-15 19:48 jbrassow
2006-06-15 19:34 jbrassow
2006-06-13 16:26 jbrassow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060629194933.2430.qmail@sourceware.org \
    --to=jbrassow@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).