From 0f0805fb4da722758a7e7102aeab61f48d27b420 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. Reviewed-on: http://gerrit.openafs.org/7140 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit 46bdb318c45b4e93a5b297e6fdee2b2acbed4b55) Change-Id: I6d5406d6e39513d3f38e7674fa726b627ca5f1f0 Reviewed-on: http://gerrit.openafs.org/7935 Tested-by: BuildBot Reviewed-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 4630e9d66..f6c8c1faf 100644 --- a/src/volser/vsprocs.c +++ b/src/volser/vsprocs.c @@ -1013,12 +1013,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