mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
vos: Restore some VNOVOL error messages
Many places in vos/vsprocs have code to delete a volume. Commit f4e73067cdef990262c69c38ac98761620a63f25 tried to refactor them by consolidating the common "delete" code into DoVolDelete. However, not all of the removed code had exactly the same behavior, and some of these variants were not handled by DoVolDelete. One such variation is that DoVolDelete always printed an error message if the target volume did not exist. But for some call sites this condition is not an error, and prior to the refactoring they did not print such an error message. Commit 1092cbe34fc8519826b3fa0565505b7bd81bc922 tried to correct this by suppressing the error message if the target volume does not exist. However, this means that all DoVolDelete calls do not print such an error, where some should and some should not print an error. This means that in some edge cases when we encounter an unexpected VNOVOL error, we now skip printing the specific error we got and instead go right to cleanup/recovery/exit. For a few other cases, we used to print an error and continue (because it is a non-fatal error or a warning), but now we print nothing when we encounter a VNOVOL error. Fix this by specifically printing an error for the VNOVOL error for DoVolDelete call sites that used to print such an error. Do this for all such sites except ones where we obviously print an error immediately afterwards anyway. This is just a quick targeted fix. A future more robust fix should involve altering DoVolDelete to handle all of the different behaviors expected by its various callers. Reviewed-on: http://gerrit.openafs.org/9704 Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> (cherry picked from commit 0a063815cc27ed065bcc9e4a91fb3a7b280818bb) Change-Id: Ia333b2257b9fdc39f7bcc9ba8ed3c98254d2e76a Reviewed-on: http://gerrit.openafs.org/9770 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
parent
ddaef4378d
commit
44e97c45f3
@ -1886,6 +1886,9 @@ UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
|
||||
code = DoVolDelete(fromconn, newVol, afrompart,
|
||||
"cloned", 0, NULL, NULL);
|
||||
if (code) {
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Failed to start transaction on %u\n", newVol);
|
||||
}
|
||||
error = code;
|
||||
goto mfail;
|
||||
}
|
||||
@ -2048,9 +2051,13 @@ UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
|
||||
fflush(STDOUT);
|
||||
}
|
||||
|
||||
if (volid && toconn)
|
||||
if (volid && toconn) {
|
||||
code = DoVolDelete(toconn, volid, atopart,
|
||||
"destination", 0, NULL, "Recovery:");
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Recovery: Failed to start transaction on %u\n", volid);
|
||||
}
|
||||
}
|
||||
|
||||
/* put source volume on-line */
|
||||
if (fromconn) {
|
||||
@ -2091,10 +2098,16 @@ UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
|
||||
if (fromconn) {
|
||||
code = DoVolDelete(fromconn, backupId, afrompart,
|
||||
"backup", 0, NULL, "Recovery:");
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Recovery: Failed to start transaction on %u\n", backupId);
|
||||
}
|
||||
|
||||
code = DoVolDelete(fromconn, afromvol, afrompart, "source",
|
||||
(atoserver != afromserver)?atoserver:0,
|
||||
NULL, NULL);
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Failed to start transaction on %u\n", afromvol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2102,6 +2115,9 @@ UV_MoveVolume2(afs_uint32 afromvol, afs_uint32 afromserver, afs_int32 afrompart,
|
||||
if (newVol) {
|
||||
code = DoVolDelete(fromconn, newVol, afrompart,
|
||||
"clone", 0, NULL, "Recovery:");
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Recovery: Failed to start transaction on %u\n", newVol);
|
||||
}
|
||||
}
|
||||
|
||||
/* unlock VLDB entry */
|
||||
@ -2480,6 +2496,9 @@ cpincr:
|
||||
code = DoVolDelete(fromconn, cloneVol, afrompart,
|
||||
"cloned", 0, NULL, NULL);
|
||||
if (code) {
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Failed to start transaction on %u\n", cloneVol);
|
||||
}
|
||||
error = code;
|
||||
goto mfail;
|
||||
}
|
||||
@ -2605,9 +2624,13 @@ cpincr:
|
||||
MapHostToNetwork(&entry);
|
||||
|
||||
/* common cleanup - delete local clone */
|
||||
if (cloneVol)
|
||||
if (cloneVol) {
|
||||
code = DoVolDelete(fromconn, cloneVol, afrompart,
|
||||
"clone", 0, NULL, "Recovery:");
|
||||
if (code == VNOVOL) {
|
||||
EPRINT1(code, "Recovery: Failed to start transaction on %u\n", cloneVol);
|
||||
}
|
||||
}
|
||||
|
||||
done: /* routine cleanup */
|
||||
if (fromconn)
|
||||
@ -7181,6 +7204,9 @@ UV_VolumeZap(afs_uint32 server, afs_int32 part, afs_uint32 volid)
|
||||
aconn = UV_Bind(server, AFSCONF_VOLUMEPORT);
|
||||
error = DoVolDelete(aconn, volid, part,
|
||||
"the", 0, NULL, NULL);
|
||||
if (error == VNOVOL) {
|
||||
EPRINT1(error, "Failed to start transaction on %u\n", volid);
|
||||
}
|
||||
|
||||
PrintError("", error);
|
||||
if (aconn)
|
||||
|
Loading…
x
Reference in New Issue
Block a user