volser: add more logs for failures during restore 52/13252/5
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Sat, 11 Aug 2018 19:51:05 +0000 (15:51 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 21 Sep 2018 12:35:35 +0000 (08:35 -0400)
In the current version of the volserver, some failures during volume
restores are not logged. In order to help debugging, this commit
introduces extra logs for possible failures during this process, so we
guarantee that an error at any point during the restore causes a
message to be logged.

Change-Id: I3647155aeb3f10316d9d7fecb5b126efc909f7b4
Reviewed-on: https://gerrit.openafs.org/13252
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/volser/dumpstuff.c

index f78c6bf..546b4f6 100644 (file)
@@ -1265,8 +1265,11 @@ RestoreVolume(struct rx_call *call, Volume * avp, int incremental,
        Log("1 Volser: RestoreVolume: Volume header missing from dump; not restored\n");
        return VOLSERREAD_DUMPERROR;
     }
-    if (ReadVolumeHeader(iodp, &vol) == VOLSERREAD_DUMPERROR)
+    if (ReadVolumeHeader(iodp, &vol) == VOLSERREAD_DUMPERROR) {
+       Log("1 Volser: RestoreVolume: Error reading volume header (id: %u); aborted\n",
+           V_id(vp));
        return VOLSERREAD_DUMPERROR;
+    }
 
     if (!delo)
        delo = ProcessIndex(vp, vLarge, &b1, &s1, 0);
@@ -1288,6 +1291,8 @@ RestoreVolume(struct rx_call *call, Volume * avp, int incremental,
     tdelo = delo;
     while (1) {
        if (ReadVnodes(iodp, vp, 0, b1, s1, b2, s2, tdelo)) {
+           Log("1 Volser: RestoreVolume: Error reading vnodes (id: %u); aborted\n",
+               V_id(vp));
            error = VOLSERREAD_DUMPERROR;
            goto clean;
        }
@@ -1296,6 +1301,8 @@ RestoreVolume(struct rx_call *call, Volume * avp, int incremental,
            break;
 
        if (ReadVolumeHeader(iodp, &vol) == VOLSERREAD_DUMPERROR) {
+           Log("1 Volser: RestoreVolume: Error reading volume header (id: %u); aborted\n",
+               V_id(vp));
            error = VOLSERREAD_DUMPERROR;
            goto out;
        }