This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL5 - clogd: Further fix for bug 464481 - 'block_on_error' flagshould not be required


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5d6b625b06cabd8983f2b6b6275263d9408c5658
Commit:        5d6b625b06cabd8983f2b6b6275263d9408c5658
Parent:        a9886d37c2981a39a422a649fedff8953518d123
Author:        Jonathan Brassow <jbrassow@redhat.com>
AuthorDate:    Tue Sep 30 15:39:54 2008 -0500
Committer:     Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Tue Sep 30 15:39:54 2008 -0500

clogd:  Further fix for bug 464481 - 'block_on_error' flag should not be required

Last checkin cleaned up kernel module.  This checkin cleans up userspace server.
---
 cmirror/src/functions.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c
index 491d46d..47d7a15 100644
--- a/cmirror/src/functions.c
+++ b/cmirror/src/functions.c
@@ -52,6 +52,7 @@ struct log_c {
 
 	int resume_override;
 
+	uint32_t block_on_error;
         enum sync {
                 DEFAULTSYNC,    /* Synchronize if necessary */
                 NOSYNC,         /* Devices known to be already in sync */
@@ -341,6 +342,7 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size)
 	struct log_c *lc = NULL;
 	struct log_c *dup;
 	enum sync sync = DEFAULTSYNC;
+	uint32_t block_on_error = 0;
 
 	int disk_log = 0;
 	char disk_path[128];
@@ -352,9 +354,9 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size)
 	if (!strtoll(argv[0], &p, 0) || *p) {
 		disk_log = 1;
 
-		if ((argc < 4) || (argc > 5)) {
+		if ((argc < 3) || (argc > 5)) {
 			LOG_ERROR("Too %s arguments to clustered_disk log type",
-				  (argc < 4) ? "few" : "many");
+				  (argc < 3) ? "few" : "many");
 			r = -EINVAL;
 			goto fail;
 		}
@@ -368,9 +370,9 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size)
 	} else {
 		disk_log = 0;
 
-		if ((argc < 3) || (argc > 4)) {
+		if ((argc < 2) || (argc > 4)) {
 			LOG_ERROR("Too %s arguments to clustered_core log type",
-				  (argc < 3) ? "few" : "many");
+				  (argc < 2) ? "few" : "many");
 			r = -EINVAL;
 			goto fail;
 		}
@@ -397,6 +399,8 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size)
 			sync = FORCESYNC;
 		else if (!strcmp(argv[i], "nosync"))
 			sync = NOSYNC;
+		else if (!strcmp(argv[i], "block_on_error"))
+			block_on_error = 1;
 	}
 
 	lc = malloc(sizeof(*lc));
@@ -410,6 +414,7 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size)
 	lc->region_size = region_size;
 	lc->region_count = region_count;
 	lc->sync = sync;
+	lc->block_on_error = block_on_error;
 	lc->sync_search = 0;
 	lc->recovering_region = (uint64_t)-1;
 	lc->disk_fd = -1;
@@ -1298,10 +1303,11 @@ static int core_status_table(struct log_c *lc, struct clog_tfr *tfr)
 	char *data = (char *)tfr->data;
 
 	params = (lc->sync == DEFAULTSYNC) ? 3 : 4;
-	tfr->data_size = sprintf(data, "clustered_core %d %u %s %sblock_on_error ",
+	tfr->data_size = sprintf(data, "clustered_core %d %u %s %s%s ",
 				 params, lc->region_size, lc->uuid,
 				 (lc->sync == DEFAULTSYNC) ? "" :
-				 (lc->sync == NOSYNC) ? "nosync " : "sync ");
+				 (lc->sync == NOSYNC) ? "nosync " : "sync ",
+				 (lc->block_on_error) ? "block_on_error" : "");
 	return 0;
 }
 
@@ -1317,11 +1323,12 @@ static int disk_status_table(struct log_c *lc, struct clog_tfr *tfr)
 	}
 
 	params = (lc->sync == DEFAULTSYNC) ? 4 : 5;
-	tfr->data_size = sprintf(data, "clustered_disk %d %d:%d %u %s %sblock_on_error ",
+	tfr->data_size = sprintf(data, "clustered_disk %d %d:%d %u %s %s%s ",
 				 params, major(statbuf.st_rdev), minor(statbuf.st_rdev),
 				 lc->region_size, lc->uuid,
 				 (lc->sync == DEFAULTSYNC) ? "" :
-				 (lc->sync == NOSYNC) ? "nosync " : "sync ");
+				 (lc->sync == NOSYNC) ? "nosync " : "sync ",
+				 (lc->block_on_error) ? "block_on_error" : "");
 	return 0;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]