From 46bdb318c45b4e93a5b297e6fdee2b2acbed4b55 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 9 Apr 2012 17:16:42 -0500 Subject: [PATCH] vos: Do not try to remove backup volume id 0 Currently we always try to delete a BK volume if we're deleting the RW. If the BK volume id is 0, this is never going to do anything, so don't try to delete it. Change-Id: I0c003040cface9999944d61637077fce1736445e Reviewed-on: http://gerrit.openafs.org/7140 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/volser/vsprocs.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/volser/vsprocs.c b/src/volser/vsprocs.c index 8bb600eb7..801489cb1 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -995,12 +995,14 @@ UV_DeleteVolume(afs_uint32 aserver, afs_int32 apart, afs_uint32 avolid) ERROR_EXIT(0); } - /* Delete backup if it exists */ - code = DoVolDelete(aconn, entry.volumeId[BACKVOL], apart, - "the backup", 0, NULL, NULL); - if (code && code != VNOVOL) { - error = code; - goto error_exit; + if (entry.volumeId[BACKVOL]) { + /* Delete backup if it exists */ + code = DoVolDelete(aconn, entry.volumeId[BACKVOL], apart, + "the backup", 0, NULL, NULL); + if (code && code != VNOVOL) { + error = code; + goto error_exit; + } } if (verbose) -- 2.39.5