diff --git a/src/tsalvaged/salvsync-debug.c b/src/tsalvaged/salvsync-debug.c index f3775350e4..b802c58786 100644 --- a/src/tsalvaged/salvsync-debug.c +++ b/src/tsalvaged/salvsync-debug.c @@ -186,7 +186,13 @@ common_prolog(struct cmd_syndesc * as, struct state * state) #endif VOptDefaults(debugUtility, &opts); - VInitVolumePackage2(debugUtility, &opts); + if (VInitVolumePackage2(debugUtility, &opts)) { + /* VInitVolumePackage2 can fail on e.g. partition attachment errors, + * but we don't really care, since all we're doing is trying to use + * SALVSYNC */ + fprintf(stderr, "errors encountered initializing volume package, but " + "trying to continue anyway\n"); + } DInit(1); if ((ti = as->parms[COMMON_PARMS_OFFSET].items)) { /* -reason */ diff --git a/src/vol/fssync-debug.c b/src/vol/fssync-debug.c index c746ed0c53..a5414d5496 100644 --- a/src/vol/fssync-debug.c +++ b/src/vol/fssync-debug.c @@ -232,7 +232,13 @@ common_prolog(struct cmd_syndesc * as, struct state * state) #endif VOptDefaults(debugUtility, &opts); - VInitVolumePackage2(debugUtility, &opts); + if (VInitVolumePackage2(debugUtility, &opts)) { + /* VInitVolumePackage2 can fail on e.g. partition attachment errors, + * but we don't really care, since all we're doing is trying to use + * FSSYNC */ + fprintf(stderr, "errors encountered initializing volume package, but " + "trying to continue anyway\n"); + } DInit(1); if ((ti = as->parms[COMMON_PARMS_OFFSET].items)) { /* -reason */ diff --git a/src/vol/salvaged.c b/src/vol/salvaged.c index 2dbbc18e01..64680fe579 100644 --- a/src/vol/salvaged.c +++ b/src/vol/salvaged.c @@ -423,7 +423,13 @@ SalvageClient(VolumeId vid, char * pname) VolumePackageOptions opts; VOptDefaults(volumeUtility, &opts); - VInitVolumePackage2(volumeUtility, &opts); + if (VInitVolumePackage2(volumeUtility, &opts)) { + /* VInitVolumePackage2 can fail on e.g. partition attachment errors, + * but we don't really care, since all we're doing is trying to use + * SALVSYNC */ + fprintf(stderr, "errors encountered initializing volume package, but " + "trying to continue anyway\n"); + } SALVSYNC_clientInit(); code = SALVSYNC_SalvageVolume(vid, pname, SALVSYNC_SALVAGE, SALVSYNC_OPERATOR, 0, NULL); @@ -511,7 +517,10 @@ SalvageServer(void) /* initialize things */ VOptDefaults(salvageServer, &opts); - VInitVolumePackage2(salvageServer, &opts); + if (VInitVolumePackage2(salvageServer, &opts)) { + Log("Shutting down: errors encountered initializing volume package\n"); + Exit(1); + } DInit(10); queue_Init(&pending_q); queue_Init(&log_cleanup_queue); diff --git a/src/vol/salvager.c b/src/vol/salvager.c index 093bbac48c..5f305c8902 100644 --- a/src/vol/salvager.c +++ b/src/vol/salvager.c @@ -324,7 +324,10 @@ handleit(struct cmd_syndesc *as, void *arock) } VOptDefaults(pt, &opts); - VInitVolumePackage2(pt, &opts); + if (VInitVolumePackage2(pt, &opts)) { + Log("errors encountered initializing volume package; salvage aborted\n"); + Exit(1); + } DInit(10); #ifdef AFS_NT40_ENV if (myjob.cj_number != NOT_CHILD) { diff --git a/src/vol/test/testpart.c b/src/vol/test/testpart.c index 9044c6c598..dc29b80847 100644 --- a/src/vol/test/testpart.c +++ b/src/vol/test/testpart.c @@ -41,7 +41,10 @@ main(argc, argv) VolumePackageOptions opts; VOptDefaults(1, &opts); - VInitVolumePackage2(1, &opts); + if (VInitVolumePackage2(1, &opts)) { + printf("errors encountered initializing volume package\n"); + exit(-1); + } VPrintDiskStats(); } diff --git a/src/volser/vol-dump.c b/src/volser/vol-dump.c index ae743ad2c9..c53ad37c96 100644 --- a/src/volser/vol-dump.c +++ b/src/volser/vol-dump.c @@ -302,7 +302,10 @@ main(int argc, char **argv) VolumePackageOptions opts; VOptDefaults(volumeUtility, &opts); - VInitVolumePackage2(volumeUtility, &opts); + if (VInitVolumePackage2(volumeUtility, &opts)) { + fprintf(stderr, "errors encountered initializing volume package, but " + "trying to continue anyway\n"); + } ts = cmd_CreateSyntax(NULL, handleit, NULL, "Dump a volume to a 'vos dump' format file without using volserver"); diff --git a/src/volser/volmain.c b/src/volser/volmain.c index 46e8541296..f9024f68ed 100644 --- a/src/volser/volmain.c +++ b/src/volser/volmain.c @@ -426,7 +426,10 @@ main(int argc, char **argv) OpenLog(AFSDIR_SERVER_VOLSERLOG_FILEPATH); VOptDefaults(volumeServer, &opts); - VInitVolumePackage2(volumeServer, &opts); + if (VInitVolumePackage2(volumeServer, &opts)) { + Log("Shutting down: errors encountered initializing volume package\n"); + exit(1); + } /* For nuke() */ Lock_Init(&localLock); DInit(40);