public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/format_text/archive.c
@ 2010-08-03 13:09 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2010-08-03 13:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-08-03 13:09:22

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

Log message:
	Fix constness warning in archive_file structure from archive.c.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1689&r2=1.1690
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38

--- LVM2/WHATS_NEW	2010/08/03 13:00:45	1.1689
+++ LVM2/WHATS_NEW	2010/08/03 13:09:21	1.1690
@@ -1,5 +1,6 @@
 Version 2.02.73 - 
 ================================
+  Fix constness warning in archive_file structure from archive.c.
   Clean generated files .exported_symbols_generated, example.conf for distclean.
   Handle failure of all mirrored log devices and all but one mirror leg. 
   Disallow 'mirrored' log type for cluster mirrors.
--- LVM2/lib/format_text/archive.c	2009/12/03 19:18:33	1.37
+++ LVM2/lib/format_text/archive.c	2010/08/03 13:09:22	1.38
@@ -50,7 +50,7 @@
 struct archive_file {
 	struct dm_list list;
 
-	char *path;
+	const char *path;
 	uint32_t index;
 };
 
@@ -353,7 +353,7 @@
 {
 	struct archive_file af;
 
-	af.path = (char *)file;
+	af.path = file;
 
 	if (!path_exists(af.path)) {
 		log_error("Archive file %s not found.", af.path);


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

* LVM2 ./WHATS_NEW lib/format_text/archive.c
@ 2010-09-09 13:13 prajnoha
  0 siblings, 0 replies; 3+ messages in thread
From: prajnoha @ 2010-09-09 13:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2010-09-09 13:13:12

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

Log message:
	Add random suffix to archive file names to prevent races when being created.
	
	In certain configurations, we're not under a VG rw lock while trying to write
	a new archive file with VG metadata. A common example is using "vgs" while
	having the content of backup and archive directories empty. The code scans the
	content of these directories and tries to determine the final index that should
	be used in archive name. Since we're not under a lock, we can get into a race
	while choosing the index which could end up showing errors about not being able
	to rename to final archive name. Let's add random number suffix to these archive
	file names so we can avoid the race.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1728&r2=1.1729
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39

--- LVM2/WHATS_NEW	2010/09/09 13:07:13	1.1728
+++ LVM2/WHATS_NEW	2010/09/09 13:13:12	1.1729
@@ -1,5 +1,6 @@
 Version 2.02.74 - 
 ==================================
+  Add random suffix to archive file names to prevent races when being created.
   Reinitialize archive and backup handling on toolcontext refresh.
   Fix opprobriously slow I/O to cluster mirrors created with --nosync.
   Make poll_mirror_progress report PROGRESS_CHECK_FAILED if LV is not a mirror.
--- LVM2/lib/format_text/archive.c	2010/08/03 13:09:22	1.38
+++ LVM2/lib/format_text/archive.c	2010/09/09 13:13:12	1.39
@@ -226,7 +226,7 @@
 	       const char *dir, const char *desc,
 	       uint32_t retain_days, uint32_t min_archive)
 {
-	int i, fd, renamed = 0;
+	int i, fd, rnum, renamed = 0;
 	uint32_t ix = 0;
 	struct archive_file *last;
 	FILE *fp = NULL;
@@ -271,9 +271,12 @@
 		ix = last->index + 1;
 	}
 
+	rnum = rand_r(&vg->cmd->rand_seed);
+
 	for (i = 0; i < 10; i++) {
 		if (dm_snprintf(archive_name, sizeof(archive_name),
-				 "%s/%s_%05u.vg", dir, vg->name, ix) < 0) {
+				 "%s/%s_%05u-%d.vg",
+				 dir, vg->name, ix, rnum) < 0) {
 			log_error("Archive file name too long.");
 			return 0;
 		}


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

* LVM2 ./WHATS_NEW lib/format_text/archive.c
@ 2006-03-07 15:43 agk
  0 siblings, 0 replies; 3+ messages in thread
From: agk @ 2006-03-07 15:43 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-03-07 15:43:05

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

Log message:
	Fix archive file expiration.

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


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

end of thread, other threads:[~2010-09-09 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-03 13:09 LVM2 ./WHATS_NEW lib/format_text/archive.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2010-09-09 13:13 prajnoha
2006-03-07 15:43 agk

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).