From d10f71d44fddd7ea6e37481cffd7ee1be2a93217 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 27 Apr 2012 12:59:25 -0500 Subject: [PATCH] vol: A GOING_OFFLINE volume should yield VOFFLINE Currently, GetVolume treats a volume in the VOL_STATE_GOING_OFFLINE state the same as VOL_STATE_SHUTTING_DOWN, and so returns VNOVOL for a GOING_OFFLINE volume, but these states are very different. GOING_OFFLINE indicates that a volume should soon be in the UNATTACHED state, so we should treat GOING_OFFLINE the same as UNATTACHED for returning errors to the user. For UNATTACHED, we return specialStatus if it's set, or VOFFLINE otherwise; so, just do the same for GOING_OFFLINE. Change-Id: Ia9500d2cfd90b8c15782a06025f39298810d0a99 Reviewed-on: http://gerrit.openafs.org/7290 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/volume.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vol/volume.c b/src/vol/volume.c index 4dd86589c8..791cd53f0d 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -4044,18 +4044,18 @@ GetVolume(Error * ec, Error * client_ec, VolId volumeId, Volume * hint, * - VOL_STATE_SHUTTING_DOWN */ if ((V_attachState(vp) == VOL_STATE_ERROR) || - (V_attachState(vp) == VOL_STATE_SHUTTING_DOWN) || - (V_attachState(vp) == VOL_STATE_GOING_OFFLINE)) { + (V_attachState(vp) == VOL_STATE_SHUTTING_DOWN)) { *ec = VNOVOL; vp = NULL; break; } /* - * short circuit with VOFFLINE for VOL_STATE_UNATTACHED and + * short circuit with VOFFLINE for VOL_STATE_UNATTACHED/GOING_OFFLINE and * VNOVOL for VOL_STATE_DELETED */ if ((V_attachState(vp) == VOL_STATE_UNATTACHED) || + (V_attachState(vp) == VOL_STATE_GOING_OFFLINE) || (V_attachState(vp) == VOL_STATE_DELETED)) { if (vp->specialStatus) { *ec = vp->specialStatus;