public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/format_text/archiver.c
@ 2012-02-08 12:50 zkabelac
  0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2012-02-08 12:50 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-08 12:50:11

Modified files:
	.              : WHATS_NEW 
	lib/format_text: archiver.c 

Log message:
	Use dm_snprintf and improve error handling
	
	Add standard error reporting with error logging.
	Use plain alloc instead of zalloc for string buffer.
	Use dm_snprintf with valid test for <0.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2268&r2=1.2269
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49

--- LVM2/WHATS_NEW	2012/02/08 12:48:14	1.2268
+++ LVM2/WHATS_NEW	2012/02/08 12:50:10	1.2269
@@ -1,5 +1,6 @@
 Version 2.02.91 -
 ===================================
+  Fix error path handling in _build_desc()
   Add range test for device number in _scan_proc_dev().
   Use signed long for sysconf() call in cmirrord.
   Do not write in front of log buffer in print_log().
--- LVM2/lib/format_text/archiver.c	2012/01/20 11:01:13	1.48
+++ LVM2/lib/format_text/archiver.c	2012/02/08 12:50:10	1.49
@@ -83,13 +83,16 @@
 	size_t len = strlen(line) + 32;
 	char *buffer;
 
-	if (!(buffer = dm_pool_zalloc(mem, strlen(line) + 32)))
-		return_NULL;
+	if (!(buffer = dm_pool_alloc(mem, len))) {
+		log_error("Failed to allocate desc.");
+		return NULL;
+	}
 
-	if (snprintf(buffer, len,
-		     "Created %s executing '%s'",
-		     before ? "*before*" : "*after*", line) < 0)
-		return_NULL;
+	if (dm_snprintf(buffer, len, "Created %s executing '%s'",
+			before ? "*before*" : "*after*", line) < 0) {
+		log_error("Failed to build desc.");
+		return NULL;
+	}
 
 	return buffer;
 }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LVM2 ./WHATS_NEW lib/format_text/archiver.c
@ 2010-12-22 13:45 zkabelac
  0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2010-12-22 13:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-12-22 13:45:33

Modified files:
	.              : WHATS_NEW 
	lib/format_text: archiver.c 

Log message:
	Add backtraces for archive and backup_locally
	
	If archive or back_locally fails - add stack trace.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1852&r2=1.1853
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36

--- LVM2/WHATS_NEW	2010/12/22 12:14:17	1.1852
+++ LVM2/WHATS_NEW	2010/12/22 13:45:33	1.1853
@@ -1,5 +1,6 @@
 Version 2.02.80 - 
 ====================================
+  Add backtraces for archive and backup_locally in check_current_backup().
   Fix memory leak in debug mode of restart_clvmd() error path.
   Log error message for pthread_join() failure in clvmd.
 
--- LVM2/lib/format_text/archiver.c	2010/12/08 20:50:49	1.35
+++ LVM2/lib/format_text/archiver.c	2010/12/22 13:45:33	1.36
@@ -452,9 +452,12 @@
 	log_suppress(old_suppress);
 
 	if (vg_backup) {
-		archive(vg_backup);
+		if (!archive(vg_backup))
+			stack;
 		free_vg(vg_backup);
 	}
-	archive(vg);
-	backup_locally(vg);
+	if (!archive(vg))
+		stack;
+	if (!backup_locally(vg))
+		stack;
 }


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LVM2 ./WHATS_NEW lib/format_text/archiver.c
@ 2009-03-23 22:57 taka
  0 siblings, 0 replies; 4+ messages in thread
From: taka @ 2009-03-23 22:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	taka@sourceware.org	2009-03-23 22:57:27

Modified files:
	.              : WHATS_NEW 
	lib/format_text: archiver.c 

Log message:
	Restore log_suppress state when metadata backup file is up-to-date.
	
	Author: Takahiro Yasui <tyasui@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1070&r2=1.1071
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20

--- LVM2/WHATS_NEW	2009/03/23 22:29:06	1.1070
+++ LVM2/WHATS_NEW	2009/03/23 22:57:27	1.1071
@@ -10,6 +10,7 @@
   Fix error message when adding metadata directory to internal list fails.
   Fix size and error message of memory allocation at backup initialization.
   Remove old metadata backup file after renaming vg.
+  Restore log_suppress state when metadata backup file is up-to-date.
 
 Version 2.02.45 - 3rd March 2009
 ================================
--- LVM2/lib/format_text/archiver.c	2009/03/23 21:56:32	1.19
+++ LVM2/lib/format_text/archiver.c	2009/03/23 22:57:27	1.20
@@ -405,8 +405,10 @@
 	/* Up-to-date backup exists? */
 	if ((vg_backup = backup_read_vg(vg->cmd, vg->name, path)) &&
 	    (vg->seqno == vg_backup->seqno) &&
-	    (id_equal(&vg->id, &vg_backup->id)))
+	    (id_equal(&vg->id, &vg_backup->id))) {
+		log_suppress(0);
 		return;
+	}
 	log_suppress(0);
 
 	if (vg_backup)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LVM2 ./WHATS_NEW lib/format_text/archiver.c
@ 2009-03-23 21:56 taka
  0 siblings, 0 replies; 4+ messages in thread
From: taka @ 2009-03-23 21:56 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	taka@sourceware.org	2009-03-23 21:56:32

Modified files:
	.              : WHATS_NEW 
	lib/format_text: archiver.c 

Log message:
	Fix size and error message of memory allocation at backup initialization.
	
	Author: Takahiro Yasui <tyasui@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1068&r2=1.1069
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19

--- LVM2/WHATS_NEW	2009/03/23 21:13:37	1.1068
+++ LVM2/WHATS_NEW	2009/03/23 21:56:32	1.1069
@@ -8,6 +8,7 @@
   Flush memory pool and fix locking in clvmd refresh and backup command.
   Fix unlocks in clvmd-corosync. Broken in 2.02.45.
   Fix error message when adding metadata directory to internal list fails.
+  Fix size and error message of memory allocation at backup initialization.
 
 Version 2.02.45 - 3rd March 2009
 ================================
--- LVM2/lib/format_text/archiver.c	2009/02/22 19:00:27	1.18
+++ LVM2/lib/format_text/archiver.c	2009/03/23 21:56:32	1.19
@@ -154,8 +154,8 @@
 		int enabled)
 {
 	if (!(cmd->backup_params = dm_pool_zalloc(cmd->libmem,
-					       sizeof(*cmd->archive_params)))) {
-		log_error("archive_params alloc failed");
+					       sizeof(*cmd->backup_params)))) {
+		log_error("backup_params alloc failed");
 		return 0;
 	}
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-08 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-08 12:50 LVM2 ./WHATS_NEW lib/format_text/archiver.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2010-12-22 13:45 zkabelac
2009-03-23 22:57 taka
2009-03-23 21:56 taka

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 read-only IMAP folder(s) and NNTP newsgroup(s).