Browse Source

Plan 9 from Bell Labs 2007-09-23

David du Colombier 16 years ago
parent
commit
41da20da03
6 changed files with 31 additions and 18 deletions
  1. 3 3
      dist/replica/_plan9.db
  2. 3 3
      dist/replica/plan9.db
  3. 3 0
      dist/replica/plan9.log
  4. 6 6
      sys/man/6/venti
  5. 2 2
      sys/man/8/venti
  6. 14 4
      sys/src/9/port/devfs.c

+ 3 - 3
dist/replica/_plan9.db

@@ -7783,7 +7783,7 @@ sys/man/6/snap - 664 sys sys 1132452694 2402
 sys/man/6/thumbprint - 664 sys sys 1019866709 1124
 sys/man/6/users - 664 sys sys 1130912014 1392
 sys/man/6/utf - 664 sys sys 1146582112 2430
-sys/man/6/venti - 664 sys sys 1188620038 10695
+sys/man/6/venti - 664 sys sys 1190504984 10701
 sys/man/6/venti.conf - 664 sys sys 1164860473 1929
 sys/man/6/vgadb - 664 sys sys 960256513 10972
 sys/man/7 - 20000000775 sys sys 1103794042 0
@@ -7863,7 +7863,7 @@ sys/man/8/tlssrv - 664 sys sys 1165623041 2589
 sys/man/8/trampoline - 664 sys sys 1126104844 1199
 sys/man/8/udpecho - 664 sys sys 954305553 303
 sys/man/8/update - 664 sys sys 961259288 2336
-sys/man/8/venti - 664 sys sys 1188620038 12188
+sys/man/8/venti - 664 sys sys 1190504986 12190
 sys/man/8/venti-backup - 664 sys sys 1188620038 2102
 sys/man/8/venti-fmt - 664 sys sys 1188620038 8626
 sys/man/8/vga - 664 sys sys 1141660952 3856
@@ -8199,7 +8199,7 @@ sys/src/9/port/devcons.c - 664 sys sys 1176658321 22943
 sys/src/9/port/devdraw.c - 664 sys sys 1147023550 44447
 sys/src/9/port/devdup.c - 664 sys sys 1014931172 2332
 sys/src/9/port/devenv.c - 664 sys sys 1169498893 7015
-sys/src/9/port/devfs.c - 664 sys sys 1180592541 13499
+sys/src/9/port/devfs.c - 664 sys sys 1190443411 13857
 sys/src/9/port/devkbmap.c - 664 sys sys 1130763846 3064
 sys/src/9/port/devkprof.c - 664 sys sys 1014931173 3111
 sys/src/9/port/devloopback.c - 664 sys sys 1138458368 14579

+ 3 - 3
dist/replica/plan9.db

@@ -7783,7 +7783,7 @@ sys/man/6/snap - 664 sys sys 1132452694 2402
 sys/man/6/thumbprint - 664 sys sys 1019866709 1124
 sys/man/6/users - 664 sys sys 1130912014 1392
 sys/man/6/utf - 664 sys sys 1146582112 2430
-sys/man/6/venti - 664 sys sys 1188620038 10695
+sys/man/6/venti - 664 sys sys 1190504984 10701
 sys/man/6/venti.conf - 664 sys sys 1164860473 1929
 sys/man/6/vgadb - 664 sys sys 960256513 10972
 sys/man/7 - 20000000775 sys sys 1103794042 0
@@ -7863,7 +7863,7 @@ sys/man/8/tlssrv - 664 sys sys 1165623041 2589
 sys/man/8/trampoline - 664 sys sys 1126104844 1199
 sys/man/8/udpecho - 664 sys sys 954305553 303
 sys/man/8/update - 664 sys sys 961259288 2336
-sys/man/8/venti - 664 sys sys 1188620038 12188
+sys/man/8/venti - 664 sys sys 1190504986 12190
 sys/man/8/venti-backup - 664 sys sys 1188620038 2102
 sys/man/8/venti-fmt - 664 sys sys 1188620038 8626
 sys/man/8/vga - 664 sys sys 1141660952 3856
@@ -8199,7 +8199,7 @@ sys/src/9/port/devcons.c - 664 sys sys 1176658321 22943
 sys/src/9/port/devdraw.c - 664 sys sys 1147023550 44447
 sys/src/9/port/devdup.c - 664 sys sys 1014931172 2332
 sys/src/9/port/devenv.c - 664 sys sys 1169498893 7015
-sys/src/9/port/devfs.c - 664 sys sys 1180592541 13499
+sys/src/9/port/devfs.c - 664 sys sys 1190443411 13857
 sys/src/9/port/devkbmap.c - 664 sys sys 1130763846 3064
 sys/src/9/port/devkprof.c - 664 sys sys 1014931173 3111
 sys/src/9/port/devloopback.c - 664 sys sys 1138458368 14579

+ 3 - 0
dist/replica/plan9.log

@@ -52820,3 +52820,6 @@
 1190406604 0 d sys/src/cmd/venti/srv/index2.c - 664 sys sys 1142736354 0
 1190406604 1 d sys/src/cmd/venti/srv/cmparena.c - 664 sys sys 1142736351 0
 1190430004 0 c sys/games/lib/fortunes - 664 sys sys 1190428693 267065
+1190444405 0 c sys/src/9/port/devfs.c - 664 sys sys 1190443411 13857
+1190505604 0 c sys/man/6/venti - 664 sys sys 1190504984 10701
+1190505604 1 c sys/man/8/venti - 664 sys sys 1190504986 12190

+ 6 - 6
sys/man/6/venti

@@ -51,7 +51,7 @@ types:
 and so on.
 .SS "Files and Directories
 Venti accepts blocks up to 56 kilobytes in size.  
-By covention, Venti clients use hash trees of blocks to
+By convention, Venti clients use hash trees of blocks to
 represent arbitrary-size data
 .IR files .
 The data to be stored is split into fixed-size
@@ -77,14 +77,14 @@ In this
 manner, arbitrary trees of files can be constructed
 and stored.
 .PP
-Scores passed between programs coventionally refer
+Scores passed between programs conventionally refer
 to
 .B VtRoot
 blocks, which contain descriptive information
 as well as the score of a directory block containing a small number
 of directory entries.
 .PP
-Coventionally, programs do not mix data and directory entries
+Conventionally, programs do not mix data and directory entries
 in the same file.  Instead, they keep two separate files, one with
 directory entries and one with metadata referencing those
 entries by position.
@@ -125,7 +125,7 @@ blocks.)
 .SS "Zero Truncation
 To avoid storing the same short data blocks padded with
 differing numbers of zeros, Venti clients working with fixed-size
-blocks coventionally
+blocks conventionally
 `zero truncate' the blocks before writing them to the server.
 For example, if a 1024-byte data block contains the 
 11-byte string 
@@ -144,7 +144,7 @@ blocks),
 trailing zero scores are removed
 instead of trailing zero bytes.
 .PP
-Because of the truncation covention,
+Because of the truncation convention,
 any file consisting entirely of zero bytes,
 no matter what its length, will be represented by the zero score:
 the data blocks contain all zeros and are thus truncated
@@ -156,7 +156,7 @@ A Venti session begins when a
 .I client
 connects to the network address served by a Venti
 .IR server ;
-the coventional address is 
+the conventional address is 
 .BI tcp! server !venti
 (the
 .B venti

+ 2 - 2
sys/man/8/venti

@@ -216,13 +216,13 @@ should be split unevenly, with more (say, two thirds)
 going to the block cache.
 .SS Network
 The venti server announces two network services, one 
-(coventionally TCP port 
+(conventionally TCP port 
 .BR venti ,
 17034) serving
 the venti protocol as described in
 .IR venti (6),
 and one serving HTTP
-(coventionally TCP port 
+(conventionally TCP port 
 .BR venti ,
 80).
 .PP

+ 14 - 4
sys/src/9/port/devfs.c

@@ -35,6 +35,8 @@ enum {
 	Maxconf	= 4*1024,	/* max length for config */
 	Ndevs	= 32,		/* max. inner devs per command */
 	Nfsdevs = 128,		/* max. created devs, total */
+	Maxretries = 3,		/* max. retries of i/o errors */
+	Retrypause = 5000,	/* ms. to pause between retries */
 };
 
 #define	Cfgstr	"fsdev:\n"
@@ -567,7 +569,11 @@ mread(Chan *c, void *a, long n, vlong off)
 				print("#k/%s: retry %d read for byte %,lld "
 					"count %ld: %s\n", mp->name, retry, off,
 					n, (up && up->errstr? up->errstr: ""));
-				tsleep(&up->sleep, return0, 0, 2000);
+				/*
+				 * pause before retrying in case it's due to
+				 * a transient bus or controller problem.
+				 */
+				tsleep(&up->sleep, return0, 0, Retrypause);
 			}
 			for (i = 0; i < mp->ndevs; i++){
 				if (waserror())
@@ -580,7 +586,7 @@ mread(Chan *c, void *a, long n, vlong off)
 					break;		/* read a good copy */
 				}
 			}
-		} while (i == mp->ndevs && ++retry < 2);
+		} while (i == mp->ndevs && ++retry <= Maxretries);
 		if (i == mp->ndevs) {
 			/* no mirror had a good copy of the block */
 			print("#k/%s: byte %,lld count %ld: CAN'T READ "
@@ -639,7 +645,11 @@ mwrite(Chan *c, void *a, long n, vlong off)
 				print("#k/%s: retry %d write for byte %,lld "
 					"count %ld: %s\n", mp->name, retry, off,
 					n, (up && up->errstr? up->errstr: ""));
-				tsleep(&up->sleep, return0, 0, 2000);
+				/*
+				 * pause before retrying in case it's due to
+				 * a transient bus or controller problem.
+				 */
+				tsleep(&up->sleep, return0, 0, Retrypause);
 			}
 			allbad = 1;
 			anybad = 0;
@@ -658,7 +668,7 @@ mwrite(Chan *c, void *a, long n, vlong off)
 				else
 					anybad = 1;
 			}
-		} while (anybad && ++retry < 2);
+		} while (anybad && ++retry <= Maxretries);
 		if (allbad) {
 			/* no mirror took a good copy of the block */
 			print("#k/%s: byte %,lld count %ld: CAN'T WRITE "