cluster/cmirror-kernel/src dm-clog-tfr.c dm-clog.c
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
cmirror-kernel/src/dm-clog-tfr.c +21 -3
@@ -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)
cmirror-kernel/src/dm-clog.c +2 -2
@@ -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 ; }