Skip Menu | Preferences | Logout
Logged in as guest
RT for grand.central.org
 
 
#123984: Add largefile and incremental dump support to voldump
X  Ticket metadata  
X  The Basics  
Id: 123984
Status: resolved
Left: 0 min
Priority: 0/0
Queue: openafs-bugs

X  People  
Owner: shadow
Requestors: tkula@umich.edu
Cc:
AdminCc:

X  Dates  
Created: Wed Dec 17 15:32:08 2008
Starts: Not set
Started: Sun Dec 21 00:12:32 2008
Last Contact: Mon Dec 22 14:02:30 2008
Due: Not set
Closed: Mon Dec 22 14:02:30 2008
Updated: Mon Dec 22 14:02:30 2008 by shadow

X  Links  
Depends on:
Depended on by:
Parents:
Children:
Refers to:
Referred to by:

X  Attachments  
vol-dump.diff

X  More about Thomas Kula  
Comments about this user:
No comment entered about this user
This user's 10 highest priority tickets:

X  History Display mode:[Brief headers] [Full headers]
#     Wed Dec 17 15:32:12 2008  tkula@umich.edu - Ticket created    
Subject: Add largefile and incremental dump support to voldump
Date: Wed, 17 Dec 2008 15:31:58 -0500
To: openafs-bugs@openafs.org
From: Thomas Kula <tkula@umich.edu>
Download(untitled)
text/plain 1.1k
* If dumping to a file, open the file with afs_open,
so you get largefile support if it is present
(without it, voldump truncates dumps to 2GB)
* Add incremental dump support. Uses code from vos.c:DumpVolume
to parse date, other than that, making sure that fromdate
gets passed all the way through to DoMyVolDump is all I had
to do.

Testing:

- Do a full dump via "vos dump" and "voldump" of a test volume.
Resultant dump files were identical in size and had identical
md5 checksums.

- Do incremental dumps via "vos dump" and "voldump", using
identical "-from" strings. Resultant dump files *were*
different in size; however, after resturing the full dump
+ vos incremental dump as "testvolumeA" and full dump +
voldump incremental dump as "testvolumeB":

- The same files/directories were present in both volumes.
- Corresponding files have identical md5 checksums.

I'd like to see more testing, but I think this is a good start.

See /afs/umich.edu/user/t/k/tkula/Public/code/vol-dump.diff,
which is also attached here as well.

--
Thomas L. Kula | tkula@umich.edu | 734.764.6531
University of Michigan - ITCS - UMCE
GPCC, IFS/IAA, Hostmaster
Downloadvol-dump.diff
text/plain 3.7k
Relative to $Header: /cvs/openafs/src/volser/vol-dump.c,v 1.1.2.2 2008/08/16 19:15:49 shadow Exp $
in OpenAFS 1.4.8

* If dumping to a file, open the file with afs_open,
so you get largefile support if it is present
(without it, voldump truncates dumps to 2GB)
* Add incremental dump support. Uses code from vos.c:DumpVolume
to parse date, other than that, making sure that fromdate
gets passed all the way through to DoMyVolDump is all I had
to do.

Testing:

- Do a full dump via "vos dump" and "voldump" of a test volume.
Resultant dump files were identical in size and had identical
md5 checksums.

- Do incremental dumps via "vos dump" and "voldump", using
identical "-from" strings. Resultant dump files *were*
different in size; however, after resturing the full dump
+ vos incremental dump as "testvolumeA" and full dump +
voldump incremental dump as "testvolumeB":

- The same files/directories were present in both volumes.
- Corresponding files have identical md5 checksums.

Thomas L. Kula <tkula@umich.edu>
17 December 2008



--- src/volser/vol-dump.c.orig 2008-12-17 10:19:48.000000000 -0500
+++ src/volser/vol-dump.c 2008-12-17 13:50:45.000000000 -0500
@@ -90,11 +90,11 @@
int verbose = 0;

/* Forward Declarations */
-void HandleVolume(struct DiskPartition64 *partP, char *name, char *filename);
+void HandleVolume(struct DiskPartition64 *partP, char *name, char *filename, int fromtime);
Volume *AttachVolume(struct DiskPartition64 *dp, char *volname,
register struct VolumeHeader *header);
static void DoMyVolDump(Volume * vp, struct DiskPartition64 *dp,
- char *dumpfile);
+ char *dumpfile, int fromtime);

#ifndef AFS_NT40_ENV
#include "AFS_component_version_number.c"
@@ -176,6 +176,8 @@
struct DiskPartition64 *partP = NULL;
char name1[128];
char tmpPartName[20];
+ int fromtime = 0;
+ afs_int32 code;


#ifndef AFS_NT40_ENV
@@ -195,6 +197,14 @@
fileName = ti->data;
if ((ti = as->parms[3].items))
verbose = 1;
+ if (as->parms[4].items && strcmp(as->parms[4].items->data, "0")) {
+ code = ktime_DateToInt32(as->parms[4].items->data, &fromtime);
+ if (code) {
+ fprintf(STDERR, "failed to parse date '%s' (error=%d))\n",
+ as->parms[4].items->data, code);
+ return code;
+ }
+ }

DInit(10);

@@ -232,12 +242,12 @@
}

(void)afs_snprintf(name1, sizeof name1, VFORMAT, (unsigned long)volumeId);
- HandleVolume(partP, name1, fileName);
+ HandleVolume(partP, name1, fileName, fromtime);
return 0;
}

void
-HandleVolume(struct DiskPartition64 *dp, char *name, char *filename)
+HandleVolume(struct DiskPartition64 *dp, char *name, char *filename, int fromtime)
{
struct VolumeHeader header;
struct VolumeDiskHeader diskHeader;
@@ -279,7 +289,7 @@
exit(1);
}

- DoMyVolDump(vp, dp, filename);
+ DoMyVolDump(vp, dp, filename, fromtime);
}


@@ -298,6 +308,7 @@
cmd_AddParm(ts, "-file", CMD_LIST, CMD_OPTIONAL, "Dump filename");
cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL,
"Trace dump progress (very verbose)");
+ cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_OPTIONAL, "dump from time");
code = cmd_Dispatch(argc, argv);
return code;
}
@@ -831,17 +842,16 @@


static void
-DoMyVolDump(Volume * vp, struct DiskPartition64 *dp, char *dumpfile)
+DoMyVolDump(Volume * vp, struct DiskPartition64 *dp, char *dumpfile, int fromtime)
{
int code = 0;
- int fromtime = 0;
int dumpAllDirs = 0;
int dumpfd = 0;

if (dumpfile) {
unlink(dumpfile);
dumpfd =
- open(dumpfile, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR);
+ afs_open(dumpfile, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR);
if (dumpfd < 0) {
fprintf(stderr, "Failed to open dump file! Exiting.\n");
exit(1);
#     Sun Dec 21 00:12:32 2008  jaltman - Status changed from new to open    
#     Mon Dec 22 14:00:50 2008  shadow - Taken    
#     Mon Dec 22 14:02:29 2008  shadow - Correspondence added    
Download(untitled)
text/plain 41b
vol-dump-incr-largefile-support-20081222
#     Mon Dec 22 14:02:30 2008  shadow - Status changed from open to resolved    
»|« RT 3.2.2 Copyright 1996-2004 Best Practical Solutions, LLC.