From b82d31dc01e8474d503a86fbf52ddf6d74c245e6 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Sun, 11 Nov 2001 00:06:39 +0000 Subject: [PATCH] Make BREADEMAX adjustable with the -I option to dump. --- CHANGES | 13 ++++++++++++- THANKS | 5 ++++- dump/dump.8.in | 17 ++++++++++++++--- dump/dump.h | 3 ++- dump/main.c | 11 +++++++++-- dump/traverse.c | 9 ++++----- 6 files changed, 45 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 755423f..cdb7894 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.140 2001/10/02 09:41:24 stelian Exp $ +$Id: CHANGES,v 1.141 2001/11/11 00:06:39 stelian Exp $ Changes between versions 0.4b24 and 0.4b25 (released ??????????????????) ======================================================================== @@ -6,6 +6,17 @@ Changes between versions 0.4b24 and 0.4b25 (released ??????????????????) 1. Added a mini howto from Patrick Walsh in the examples directory. +2. Minor man pages syntax corrections. Thanks to + Chris Danis for reporting the bugs. + +3. Added a script from David B. Peterson + to the examples section. It features dumping several + filesystems to a remote tape drive upon ssh. + +4. Added a patch provided by Richard Jones + which allows BRADEMAX (number of read errors tolerated by + dump) to be adjusted using the -I option. + Changes between versions 0.4b23 and 0.4b24 (released September 12, 2001) ======================================================================== diff --git a/THANKS b/THANKS index 4e4b0f8..9336679 100644 --- a/THANKS +++ b/THANKS @@ -1,4 +1,4 @@ -$Id: THANKS,v 1.47 2001/09/06 09:00:31 stelian Exp $ +$Id: THANKS,v 1.48 2001/11/11 00:06:39 stelian Exp $ Dump and restore were written by the people of the CSRG at the University of California, Berkeley. @@ -29,6 +29,7 @@ Rob Cermak cermak@ahab.rutgers.edu Isaac Chuang ike@isl.stanford.edu Rainer Clasen bj@ncc.cicely.de W. Reilly Cooley wcooley@nakedape.cc +Chris Danis screechco@home.com Abhijit Dasgupta abhijit@ans.net John R. Dennison gerdesas@users.sourceforge.net Andreas Dilger adilger@turbolinux.com @@ -44,6 +45,7 @@ Jean-Paul van der Jagt jeanpaul@dutepp0.et.tudelft.nl Helmut Jarausch jarausch@igpm.rwth-aachen.de Eric Jergensen eric@dvns.com Jeff Johnson jbj@redhat.com +Richard Jones rich@annexia.org Charles Karney karney@users.sourceforge.net Henry Katz hkatz@hkatz.dialup.access.net Klaus Kudielka kkudielk@cacofonix.nt.tuwien.ac.at @@ -60,6 +62,7 @@ Lukas Nellen L.Nellen@ThPhys.Uni-Heidelberg.DE Nuno Oliveira nuno@eq.uc.pt Brent Olson night@halcyon.com Jerry Peters gapeters@worldnet.att.net +David B. Peterson dave@toppledwagon.com Dave Platt dplatt@snulbug.mtview.ca.us Kenneth Porter shiva@well.com Graham Reed greed@users.sourceforge.net diff --git a/dump/dump.8.in b/dump/dump.8.in index b3171ca..fa0578b 100644 --- a/dump/dump.8.in +++ b/dump/dump.8.in @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dump.8.in,v 1.33 2001/11/10 23:50:59 stelian Exp $ +.\" $Id: dump.8.in,v 1.34 2001/11/11 00:06:39 stelian Exp $ .\" .Dd __DATE__ .Dt DUMP 8 @@ -49,6 +49,7 @@ .Op Fl f Ar file .Op Fl F Ar script .Op Fl h Ar level +.Op Fl I Ar nr errors .Op Fl j Ar compression level .Op Fl L Ar label .Op Fl Q Ar file @@ -221,6 +222,15 @@ For security reasons, .Nm reverts back to the real user ID and the real group ID before running the script. +.It Fl I Ar nr errors +By default, +.Nm +will ignore the first 32 read errors on the file +system before asking for operator intervention. You can change this +using this flag to any value. This is useful when running +.Nm +on an active filesystem where read errors simply indicate an +inconsistency between the mapping and dumping passes. .It Fl j Ar compression level Compress every block to be written on the tape using bzlib library. This option will work only when dumping to a file or pipe or, when dumping @@ -382,7 +392,7 @@ end of tape, end of dump, tape write error, tape open error or -disk read error (if there is more than a threshold of 32). +disk read error (if there is more than a threshold of nr errors). In addition to alerting all operators implied by the .Fl n key, @@ -514,7 +524,8 @@ abnormal termination is indicated with an exit code of 3. It might be considered a bug that this version of dump can only handle ext2 filesystems. Specifically, it does not work with FAT filesystems. .Pp -Fewer than 32 read errors on the filesystem are ignored. If noticing +Fewer than 32 read errors (change this with -I) +on the filesystem are ignored. If noticing read errors is important, the output from dump can be parsed to look for lines that contain the text 'read error'. .Pp diff --git a/dump/dump.h b/dump/dump.h index 4f46fa4..5d22dbb 100644 --- a/dump/dump.h +++ b/dump/dump.h @@ -5,7 +5,7 @@ * Stelian Pop , 1999-2000 * Stelian Pop - AlcĂ´ve , 2000 * - * $Id: dump.h,v 1.32 2001/08/16 15:24:21 stelian Exp $ + * $Id: dump.h,v 1.33 2001/11/11 00:06:39 stelian Exp $ */ /*- @@ -77,6 +77,7 @@ extern int bzipflag; /* compression is done using bzlib */ extern int uflag; /* update flag */ extern int Mflag; /* multi-volume flag */ extern int qflag; /* quit on errors flag */ +extern int breademax; /* maximum number of bread errors before we quit */ extern char *eot_script; /* end of volume script fiag */ extern int diskfd; /* disk file descriptor */ extern int tapefd; /* tape file descriptor */ diff --git a/dump/main.c b/dump/main.c index 722ca71..e1d3db3 100644 --- a/dump/main.c +++ b/dump/main.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.60 2001/09/06 09:00:32 stelian Exp $"; + "$Id: main.c,v 1.61 2001/11/11 00:06:39 stelian Exp $"; #endif /* not lint */ #include @@ -107,6 +107,7 @@ int bzipflag; /* compression is done using bzlib */ int uflag; /* update flag */ int Mflag; /* multi-volume flag */ int qflag; /* quit on errors flag */ +int breademax = 32; /* maximum number of bread errors before we quit */ char *eot_script; /* end of volume script fiag */ int diskfd; /* disk file descriptor */ int tapefd; /* tape file descriptor */ @@ -236,7 +237,7 @@ main(int argc, char *argv[]) #endif /* USE_QFA */ while ((ch = getopt(argc, argv, - "0123456789aB:b:cd:e:E:f:F:h:" + "0123456789aB:b:cd:e:E:f:F:h:I:" #ifdef HAVE_BZLIB "j::" #endif @@ -333,6 +334,11 @@ main(int argc, char *argv[]) break; #endif /* HAVE_BZLIB */ + case 'I': + breademax = + numarg ("number of errors to ignore", 1L, 0L); + break; + #ifdef KERBEROS case 'k': dokerberos = 1; @@ -979,6 +985,7 @@ usage(void) "MnqSu" "] [-B records] [-b blocksize] [-d density]\n" "\t%s [-e inode#,inode#,...] [-E file] [-f file] [-h level] " + "[-I nr errors] " #ifdef HAVE_BZLIB "[-j zlevel] " #endif diff --git a/dump/traverse.c b/dump/traverse.c index 975f6f8..ffcac88 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.38 2001/08/17 09:55:09 stelian Exp $"; + "$Id: traverse.c,v 1.39 2001/11/11 00:06:39 stelian Exp $"; #endif /* not lint */ #include @@ -1239,11 +1239,10 @@ getino(dump_ino_t inum) /* * Read a chunk of data from the disk. * Try to recover from hard errors by reading in sector sized pieces. - * Error recovery is attempted at most BREADEMAX times before seeking + * Error recovery is attempted at most breademax times before seeking * consent from the operator to continue. */ int breaderrors = 0; -#define BREADEMAX 32 void bread(daddr_t blkno, char *buf, int size) @@ -1282,9 +1281,9 @@ loop: else msg("short read error from %s: [block %d]: count=%d, got=%d\n", disk, blkno, size, cnt); - if (++breaderrors > BREADEMAX) { + if (++breaderrors > breademax) { msg("More than %d block read errors from %d\n", - BREADEMAX, disk); + breademax, disk); broadcast("DUMP IS AILING!\n"); msg("This is an unrecoverable error.\n"); if (!query("Do you want to attempt to continue?")){ -- 2.39.2