All of lore.kernel.org
 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-clog-tfr.c dm-clog.c
Date: 14 Jan 2008 22:46:59 -0000	[thread overview]
Message-ID: <20080114224659.20299.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	jbrassow at sourceware.org	2008-01-14 22:46:58

Modified files:
	cmirror-kernel/src: dm-clog-tfr.c dm-clog.c 

Log message:
	- clear memory before it is written to.  (was causing mirror CTR to fail).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog-tfr.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-clog.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.4&r2=1.2.2.5

--- cluster/cmirror-kernel/src/dm-clog-tfr.c	2007/11/08 22:16:53	1.1.2.3
+++ cluster/cmirror-kernel/src/dm-clog-tfr.c	2008/01/14 22:46:58	1.1.2.4
@@ -12,6 +12,8 @@
 #include "dm.h"
 #include "dm-clog-tfr.h"
 
+#include <asm/div64.h> /* Unnecessary */
+
 static uint64_t seq = 0;
 
 /*
@@ -28,6 +30,7 @@
 	struct list_head list;
 	struct completion complete;
 
+	unsigned long long start_time;
 	uint64_t seq;
 
 	int error;
@@ -120,6 +123,7 @@
  *
  * Returns: 0 on success, -EXXX on failure
  */
+static uint32_t foo[15]; /* FIXME: Pull this... Track number of sec */
 int dm_clog_consult_server(const char *uuid, int request_type,
 			   char *data, int data_size,
 			   char *rdata, int *rdata_size)
@@ -133,8 +137,9 @@
 	if (data_size > (DM_CLOG_PREALLOCED_SIZE - overhead_size)) {
 		DMINFO("Size of tfr exceeds preallocated size");
 		/* FIXME: is kmalloc sufficient if we need this much space? */
-		tfr = kmalloc(data_size + sizeof(*tfr), GFP_NOIO);
-	}
+		tfr = kzalloc(data_size + sizeof(*tfr), GFP_NOIO);
+	} else
+		memset(tfr, 0, DM_CLOG_PREALLOCED_SIZE - overhead_size);
 
 	if (!tfr)
 		return -ENOMEM;
@@ -148,7 +153,6 @@
 	 */
 	mutex_lock(&_lock);
 
-	memset(tfr, 0, data_size + sizeof(*tfr));
 	memcpy(tfr->uuid, uuid, DM_UUID_LEN);
 	tfr->seq = seq++;
 	tfr->request_type = request_type;
@@ -164,6 +168,7 @@
 	spin_lock(&recieving_list_lock);
 	list_add(&(pkg.list), &recieving_list);
 	spin_unlock(&recieving_list_lock);
+	pkg.start_time = jiffies;
 
 	r = dm_clog_sendto_server(tfr);
 
@@ -184,7 +189,20 @@
 		list_del_init(&(pkg.list));
 		spin_unlock(&recieving_list_lock);
 
+		foo[10]++;
+		DMWARN("[%u][%u][%u][%u][%u][%u] [%u]",
+		       foo[0], foo[1], foo[2], foo[3], foo[4], foo[5],
+		       foo[10]);
+
 		goto resend;
+	} else { 
+		/* FIXME: Pull time checking code - it's just for profiling */
+		pkg.start_time = (jiffies - pkg.start_time);
+		do_div(pkg.start_time, HZ);
+		if ((pkg.start_time < 0) || (pkg.start_time >= 5))
+			DMWARN("OUT-OF-BOUNDS::  pkg.start_time == %llu", pkg.start_time);
+		else
+			foo[pkg.start_time]++;
 	}
 	r = pkg.error;
 	if (r)
--- cluster/cmirror-kernel/src/dm-clog.c	2007/11/03 18:37:48	1.2.2.4
+++ cluster/cmirror-kernel/src/dm-clog.c	2008/01/14 22:46:58	1.2.2.5
@@ -654,7 +654,7 @@
 		return r;
 	}
 
-	DMINFO("dm-log-clustered (built %s %s) installed", __DATE__, __TIME__);
+	DMINFO("(built %s %s) installed", __DATE__, __TIME__);
 	return 0;
 }
 
@@ -664,7 +664,7 @@
 	dm_unregister_dirty_log_type(&_clustered_core_type);
 	dm_clog_tfr_exit();
 	mempool_destroy(flush_entry_pool);
-	DMINFO("dm-log-clustered (built %s %s) removed", __DATE__, __TIME__);
+	DMINFO("(built %s %s) removed", __DATE__, __TIME__);
 	return;
 }
 



             reply	other threads:[~2008-01-14 22:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 22:46 jbrassow [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-02-08 14:21 [Cluster-devel] cluster/cmirror-kernel/src dm-clog-tfr.c dm-clog.c 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=20080114224659.20299.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.