From 89b50fdec9ab2dafe24b873f25c2cdb71b154e44 Mon Sep 17 00:00:00 2001 From: Marcio Barbosa Date: Sat, 11 Aug 2018 15:51:05 -0400 Subject: [PATCH] volser: add more logs for failures during restore 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 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/volser/dumpstuff.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/volser/dumpstuff.c b/src/volser/dumpstuff.c index f78c6bf534..546b4f657b 100644 --- a/src/volser/dumpstuff.c +++ b/src/volser/dumpstuff.c @@ -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; }