S<<< [B<-vlruthresh> <I<minutes before eligibility for soft detach>>] >>>
S<<< [B<-vlruinterval> <I<seconds between VLRU scans>>] >>>
S<<< [B<-vlrumax> <I<max volumes to soft detach in one VLRU scan>>] >>>
+ S<<< [B<-unsafe-nosalvage>] >>>
S<<< [B<-vattachpar> <I<number of volume attach threads>>] >>>
S<<< [B<-m> <I<min percentage spare in partition>>] >>>
S<<< [B<-lock>] >>>
This option is only supported by the demand-attach file server.
+=item B<-unsafe-nosalvage>
+
+This option causes the fileserver to bypass the normal safety check when
+attaching volumes that checks the inUse field in the volume header. With
+this option, volumes that were in use at the time of an unclean shutdown
+will not be salvaged immediately the next time they are accessed, and thus
+risk (possibly silent and/or irrevocable) corruption. Volumes will still
+be salvaged when an internal inconsistency is detected or other cases
+where a salvage would normally occur.
+
+Due to the increased risk of data corruption, the use of this flag is
+strongly discouraged. Only use it if you really know what you are doing.
+
+This option is only supported by the demand-attach file server.
+
=item B<-vattachpar> <I<number of volume attach threads>>
The number of threads assigned to attach and detach volumes. The default
int udpBufSize = 0; /* UDP buffer size for receive */
int sendBufSize = 16384; /* send buffer size */
int saneacls = 0; /* Sane ACLs Flag */
+static int unsafe_attach = 0; /* avoid inUse check on vol attach? */
struct timeval tp;
fputs("[-vlruthresh <minutes before unused volumes become eligible for soft detach> (default is 2 hours)] ", stdout);
fputs("[-vlruinterval <seconds between VLRU scans> (default is 2 minutes)] ", stdout);
fputs("[-vlrumax <max volumes to soft detach in one VLRU scan> (default is 8)] ", stdout);
+ fputs("[-unsafe-nosalvage (bypass volume inUse safety check on attach, bypassing salvage)] ", stdout);
#elif AFS_PTHREAD_ENV
fputs("[-vattachpar <number of volume attach threads> (default is 1)] ", stdout);
#endif
return -1;
}
VLRU_SetOptions(VLRU_SET_MAX, atoi(argv[++i]));
+ } else if (!strcmp(argv[i], "-unsafe-nosalvage")) {
+ unsafe_attach = 1;
#endif /* AFS_DEMAND_ATTACH_FS */
} else if (!strcmp(argv[i], "-s")) {
Sawsmall = 1;
opts.nLargeVnodes = large;
opts.nSmallVnodes = nSmallVns;
opts.volcache = volcache;
+ opts.unsafe_attach = unsafe_attach;
if (VInitVolumePackage2(fileServer, &opts)) {
ViceLog(0,
/***************************************************/
/* Startup routines */
/***************************************************/
+
+#if defined(FAST_RESTART) && defined(AFS_DEMAND_ATTACH_FS)
+# error FAST_RESTART and DAFS are incompatible. For the DAFS equivalent \
+ of FAST_RESTART, use the -unsafe-nosalvage fileserver argument
+#endif
+
/**
* assign default values to a VolumePackageOptions struct.
*
opts->canUseFSSYNC = 0;
opts->canUseSALVSYNC = 0;
+#ifdef FAST_RESTART
+ opts->unsafe_attach = 1;
+#else /* !FAST_RESTART */
+ opts->unsafe_attach = 0;
+#endif /* !FAST_RESTART */
+
switch (pt) {
case fileServer:
opts->canScheduleSalvage = 1;
VOL_LOCK;
vp->nextVnodeUnique = V_uniquifier(vp);
-#ifndef FAST_RESTART
if (VShouldCheckInUse(mode) && V_inUse(vp) && VolumeWriteable(vp)) {
if (!V_needsSalvaged(vp)) {
V_needsSalvaged(vp) = 1;
goto error;
}
-#endif /* FAST_RESTART */
if (programType == fileServer && V_destroyMe(vp) == DESTROY_ME) {
/* Only check destroyMe if we are the fileserver, since the
{
return vol_opts.canUseSALVSYNC;
}
+
+afs_int32
+VCanUnsafeAttach(void)
+{
+ return vol_opts.unsafe_attach;
+}
* find a bad vol) */
afs_int32 canUseFSSYNC; /**< can we use the FSSYNC channel? */
afs_int32 canUseSALVSYNC; /**< can we use the SALVSYNC channel? (DAFS) */
+ afs_int32 unsafe_attach; /**< can we bypass checking the inUse vol
+ * header on attach? */
} VolumePackageOptions;
/* Magic numbers and version stamps for each type of file */
extern afs_int32 VCanScheduleSalvage(void);
extern afs_int32 VCanUseFSSYNC(void);
extern afs_int32 VCanUseSALVSYNC(void);
+extern afs_int32 VCanUnsafeAttach(void);
extern afs_int32 VReadVolumeDiskHeader(VolumeId volid,
struct DiskPartition64 * dp,
VolumeDiskHeader_t * hdr);
static_inline int
VShouldCheckInUse(int mode)
{
+ if (VCanUnsafeAttach()) {
+ return 0;
+ }
if (programType == fileServer) {
return 1;
}